From 5ed0dcc00100c2f361e917760bd114a7af12394a Mon Sep 17 00:00:00 2001 From: Faidon Liambotis Date: Tue, 9 Jan 2024 12:52:51 +0200 Subject: [PATCH] rust: remove dependency on itertools The only use for itertools is in parse_mount_options() where we take a vector, convert it to iterator and then join it. Instead, we can join the vector directly. Signed-off-by: Kent Overstreet --- rust-src/Cargo.lock | 10 ---------- rust-src/Cargo.toml | 1 - rust-src/src/cmd_mount.rs | 3 +-- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/rust-src/Cargo.lock b/rust-src/Cargo.lock index a99cd474..091f7607 100644 --- a/rust-src/Cargo.lock +++ b/rust-src/Cargo.lock @@ -99,7 +99,6 @@ dependencies = [ "errno 0.2.8", "gag", "getset", - "itertools", "libc", "log", "parse-display", @@ -407,15 +406,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "itertools" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" -dependencies = [ - "either", -] - [[package]] name = "lazy_static" version = "1.4.0" diff --git a/rust-src/Cargo.toml b/rust-src/Cargo.toml index d1d42b35..84107d41 100644 --- a/rust-src/Cargo.toml +++ b/rust-src/Cargo.toml @@ -21,7 +21,6 @@ udev = "0.7.0" uuid = "1.2.2" gag = "1.0.0" getset = "0.1" -itertools = "0.9" parse-display = "0.1" errno = "0.2" either = "1.5" diff --git a/rust-src/src/cmd_mount.rs b/rust-src/src/cmd_mount.rs index 3f8253f5..6db109c4 100644 --- a/rust-src/src/cmd_mount.rs +++ b/rust-src/src/cmd_mount.rs @@ -76,12 +76,11 @@ fn parse_mount_options(options: impl AsRef) -> (Option, libc::c_ulo } }); - use itertools::Itertools; ( if opts.len() == 0 { None } else { - Some(opts.iter().join(",")) + Some(opts.join(",")) }, flags, )