]> git.sesse.net Git - bcachefs-tools-debian/blob - rust-src/src/lib.rs
A small compile fix
[bcachefs-tools-debian] / rust-src / src / lib.rs
1 pub mod key;
2 pub mod cmd_mount;
3 pub mod cmd_list;
4
5 #[macro_export]
6 macro_rules! c_str {
7     ($lit:expr) => {
8         unsafe {
9             std::ffi::CStr::from_ptr(concat!($lit, "\0").as_ptr() as *const std::os::raw::c_char)
10                 .to_bytes_with_nul()
11                 .as_ptr() as *const std::os::raw::c_char
12         }
13     };
14 }
15
16 #[derive(Debug)]
17 struct ErrnoError(errno::Errno);
18 impl std::fmt::Display for ErrnoError {
19     fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> {
20         self.0.fmt(f)
21     }
22 }
23 impl std::error::Error for ErrnoError {}