global: renames + refactor + p2a support

This commit is contained in:
nym21
2025-04-25 18:16:23 +02:00
parent 1492834d1e
commit 07618ebe43
51 changed files with 2802 additions and 1833 deletions

View File

@@ -0,0 +1,12 @@
#[allow(clippy::result_unit_err)]
pub fn copy_first_8bytes(slice: &[u8]) -> Result<[u8; 8], ()> {
let mut buf: [u8; 8] = [0; 8];
let buf_len = buf.len();
if slice.len() < buf_len {
return Err(());
}
slice.iter().take(buf_len).enumerate().for_each(|(i, r)| {
buf[i] = *r;
});
Ok(buf)
}

View File

@@ -1,8 +1,10 @@
mod bytes;
mod checked_sub;
mod paths;
mod pause;
mod rlimit;
pub use bytes::*;
pub use checked_sub::*;
pub use paths::*;
pub use pause::*;