bcachefs-tools/rust-src/src/lib.rs
TruongSinh Tran-Nguyen 47ec3ed6ed chore: logger for idiomatic style and expanded logging levels
Improve the Rust logger by adhering to idiomatic Rust conventions and
incorporating additional logging levels: warn, debug, and trace.

Signed-off-by: TruongSinh Tran-Nguyen <i@truongsinh.pro>
2023-04-26 17:46:23 -04:00

25 lines
595 B
Rust

pub mod key;
pub mod logger;
pub mod cmd_mount;
pub mod cmd_list;
#[macro_export]
macro_rules! c_str {
($lit:expr) => {
unsafe {
std::ffi::CStr::from_ptr(concat!($lit, "\0").as_ptr() as *const std::os::raw::c_char)
.to_bytes_with_nul()
.as_ptr() as *const std::os::raw::c_char
}
};
}
#[derive(Debug)]
struct ErrnoError(errno::Errno);
impl std::fmt::Display for ErrnoError {
fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> {
self.0.fmt(f)
}
}
impl std::error::Error for ErrnoError {}