unsafe fn push_pct_encoded(v: &mut Vec<u8>, x: u8) {
    let len = v.len();
    debug_assert!(len + 2 < v.capacity());
    // SAFETY: The caller must ensure that the capacity is enough.
    unsafe {
        let ptr = v.as_mut_ptr().add(len);
        *ptr = b'%';
        *ptr.add(1) = HEX_TABLE[x as usize * 2];
        *ptr.add(2) = HEX_TABLE[x as usize * 2 + 1];

        v.set_len(len + 3);
    }
}
/// Pushes a percent-encoded byte without checking bounds.
///
/// # Safety
///
/// `v.len() + 3` must not exceed `v.capacity()`.
Pushes a percent-encoded byte without checking bounds.
Pushes a percent - encoded byte without checking bounds .
unsafe fn push_pct_encoded(v: &mut Vec<u8>, x: u8) {
    let len = v.len();
    debug_assert!(len + 2 < v.capacity());
    // SAFETY: The caller must ensure that the capacity is enough.
    unsafe {
        let ptr = v.as_mut_ptr().add(len);
        *ptr = b'%';
        *ptr.add(1) = HEX_TABLE[x as usize * 2];
        *ptr.add(2) = HEX_TABLE[x as usize * 2 + 1];
        v.set_len(len + 3);
    }
}
unsafe fn push_pct_encoded ( v : & mut Vec < u8 > , x : u8 ) { let len = v . len ( ) ; debug_assert ! ( len 2 v capacity ( ) ) ; // SAFETY: The caller must ensure that the capacity is enough. unsafe { let ptr = v . as_mut_ptr ( ) . add ( len ) ; * ptr = b'%' ; * ptr . add ( 1 ) = HEX_TABLE [ x as usize * 2 ] ; * ptr . add ( 2 ) = HEX_TABLE [ x as usize * 2 + 1 ] ; v . set_len ( len + 3 ) ; } }
Pushes a percent-encoded byte without checking bounds.
Pushes a percent - encoded byte without checking bounds .
v
&mut Vec<u8>
x
u8
v
&mut Vec<u8>
x
u8
safety
`v.len() + 3` must not exceed `v.capacity()`.
` v . len () + 3 ` must not exceed ` v . capacity () ` .