bitnuc 0.5.2

A library for efficient nucleotide sequence manipulation using 2-bit encoding
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/// Performs an uninitialized resize of the buffer to the specified length.
///
///
/// # Safety
///
/// This should only be called when the buffer will be immediately
/// rewritten and filled with new data.
#[allow(clippy::uninit_vec)]
pub(crate) fn resize(buf: &mut Vec<u8>, size: usize) {
    if buf.len() < size {
        buf.reserve(size - buf.len());
        unsafe {
            buf.set_len(size); // uninitialized resize
        }
    }
}