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 <kent.overstreet@linux.dev>
This commit is contained in:
Faidon Liambotis 2024-01-09 12:52:51 +02:00 committed by Kent Overstreet
parent aefc264401
commit 5ed0dcc001
3 changed files with 1 additions and 13 deletions

10
rust-src/Cargo.lock generated
View File

@ -99,7 +99,6 @@ dependencies = [
"errno 0.2.8", "errno 0.2.8",
"gag", "gag",
"getset", "getset",
"itertools",
"libc", "libc",
"log", "log",
"parse-display", "parse-display",
@ -407,15 +406,6 @@ dependencies = [
"windows-sys", "windows-sys",
] ]
[[package]]
name = "itertools"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b"
dependencies = [
"either",
]
[[package]] [[package]]
name = "lazy_static" name = "lazy_static"
version = "1.4.0" version = "1.4.0"

View File

@ -21,7 +21,6 @@ udev = "0.7.0"
uuid = "1.2.2" uuid = "1.2.2"
gag = "1.0.0" gag = "1.0.0"
getset = "0.1" getset = "0.1"
itertools = "0.9"
parse-display = "0.1" parse-display = "0.1"
errno = "0.2" errno = "0.2"
either = "1.5" either = "1.5"

View File

@ -76,12 +76,11 @@ fn parse_mount_options(options: impl AsRef<str>) -> (Option<String>, libc::c_ulo
} }
}); });
use itertools::Itertools;
( (
if opts.len() == 0 { if opts.len() == 0 {
None None
} else { } else {
Some(opts.iter().join(",")) Some(opts.join(","))
}, },
flags, flags,
) )