diff options
-rw-r--r-- | rust-src/Cargo.toml | 3 | ||||
-rw-r--r-- | rust-src/src/bcachefs.rs | 21 | ||||
-rw-r--r-- | rust-src/src/commands/cmd_completions.rs (renamed from rust-src/src/cmd_completions.rs) | 0 | ||||
-rw-r--r-- | rust-src/src/commands/cmd_list.rs (renamed from rust-src/src/cmd_list.rs) | 0 | ||||
-rw-r--r-- | rust-src/src/commands/cmd_mount.rs (renamed from rust-src/src/cmd_mount.rs) | 0 | ||||
-rw-r--r-- | rust-src/src/commands/logger.rs (renamed from rust-src/src/logger.rs) | 0 | ||||
-rw-r--r-- | rust-src/src/commands/mod.rs (renamed from rust-src/src/lib.rs) | 10 |
7 files changed, 17 insertions, 17 deletions
diff --git a/rust-src/Cargo.toml b/rust-src/Cargo.toml index 2786fc76..66d7bc6a 100644 --- a/rust-src/Cargo.toml +++ b/rust-src/Cargo.toml @@ -9,9 +9,6 @@ rust-version = "1.65" name = "bcachefs" path = "src/bcachefs.rs" -[lib] -name = "bcachefs" - [dependencies] atty = "0.2.14" log = { version = "0.4", features = ["std"] } diff --git a/rust-src/src/bcachefs.rs b/rust-src/src/bcachefs.rs index 3d7af3d4..95f5e1f0 100644 --- a/rust-src/src/bcachefs.rs +++ b/rust-src/src/bcachefs.rs @@ -1,11 +1,24 @@ +mod commands; +mod key; + use std::ffi::CString; -use bcachefs::cmd_completions::cmd_completions; -use bcachefs::cmd_list::cmd_list; -use bcachefs::cmd_mount::cmd_mount; -use bcachefs::logger::SimpleLogger; +use commands::cmd_completions::cmd_completions; +use commands::cmd_list::cmd_list; +use commands::cmd_mount::cmd_mount; +use commands::logger::SimpleLogger; use bch_bindgen::c; +#[derive(Debug)] +pub struct ErrnoError(pub 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 {} + fn handle_c_command(args: Vec<String>, symlink_cmd: Option<&str>) -> i32 { let mut argv: Vec<_> = args.clone(); diff --git a/rust-src/src/cmd_completions.rs b/rust-src/src/commands/cmd_completions.rs index 53cdd643..53cdd643 100644 --- a/rust-src/src/cmd_completions.rs +++ b/rust-src/src/commands/cmd_completions.rs diff --git a/rust-src/src/cmd_list.rs b/rust-src/src/commands/cmd_list.rs index cb352916..cb352916 100644 --- a/rust-src/src/cmd_list.rs +++ b/rust-src/src/commands/cmd_list.rs diff --git a/rust-src/src/cmd_mount.rs b/rust-src/src/commands/cmd_mount.rs index b120c91e..b120c91e 100644 --- a/rust-src/src/cmd_mount.rs +++ b/rust-src/src/commands/cmd_mount.rs diff --git a/rust-src/src/logger.rs b/rust-src/src/commands/logger.rs index 2cd7b363..2cd7b363 100644 --- a/rust-src/src/logger.rs +++ b/rust-src/src/commands/logger.rs diff --git a/rust-src/src/lib.rs b/rust-src/src/commands/mod.rs index f8b508dc..e05a0848 100644 --- a/rust-src/src/lib.rs +++ b/rust-src/src/commands/mod.rs @@ -1,6 +1,5 @@ use clap::Subcommand; -pub mod key; pub mod logger; pub mod cmd_mount; pub mod cmd_list; @@ -30,12 +29,3 @@ macro_rules! c_str { } }; } - -#[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 {} |