diff options
author | Thomas Bertschinger <tahbertschinger@gmail.com> | 2024-01-15 23:41:00 -0700 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-16 01:46:41 -0500 |
commit | 0a284fc4ffcbb46f0a4b921415ef12a9c75fa05c (patch) | |
tree | 22aa82b7448833713ca975eb3c241f607742fc78 /rust-src/src/lib.rs | |
parent | 249bf7b9d446092e1b744c366b7e8c4563a437f0 (diff) |
convert main() from C to Rust
This moves the main() function from C to Rust. It also updates the name
of the Rust package from "bcachefs-rust" to "bcachefs-tools".
Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'rust-src/src/lib.rs')
-rw-r--r-- | rust-src/src/lib.rs | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/rust-src/src/lib.rs b/rust-src/src/lib.rs index 026cca49..f8b508dc 100644 --- a/rust-src/src/lib.rs +++ b/rust-src/src/lib.rs @@ -2,7 +2,6 @@ use clap::Subcommand; pub mod key; pub mod logger; -pub mod cmd_main; pub mod cmd_mount; pub mod cmd_list; pub mod cmd_completions; @@ -32,18 +31,6 @@ macro_rules! c_str { }; } -#[macro_export] -macro_rules! transform_c_args { - ($var:ident, $argc:expr, $argv:expr) => { - // TODO: `OsStr::from_bytes` only exists on *nix - use ::std::os::unix::ffi::OsStrExt; - let $var: Vec<_> = (0..$argc) - .map(|i| unsafe { ::std::ffi::CStr::from_ptr(*$argv.add(i as usize)) }) - .map(|i| ::std::ffi::OsStr::from_bytes(i.to_bytes())) - .collect(); - }; -} - #[derive(Debug)] struct ErrnoError(errno::Errno); impl std::fmt::Display for ErrnoError { |