diff --git a/Cargo.toml b/Cargo.toml
index 7030c0e..567b29e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,14 +11,12 @@ repository = "https://github.com/cat-in-136/cargo-generate-rpm"
version = "0.11.1"
edition = "2018"
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-
[dependencies]
glob = "0.3.0"
-rpm = { version = "0.11.0", default-features = false }
+rpm = { version = "0.12", default-features = false }
toml = "0.7"
cargo_toml = "0.15"
-getopts = "0.2"
+clap = { version = "4.3", features = ["derive"] }
thiserror = "1"
elf = "0.7"
diff --git a/src/auto_req/builtin.rs b/src/auto_req/builtin.rs
index c1ab54a..92781dd 100644
--- a/src/auto_req/builtin.rs
+++ b/src/auto_req/builtin.rs
@@ -77,17 +77,17 @@ fn find_requires_by_ldd(
.map_err(|e| AutoReqError::ProcessError(OsString::from("ldd"), e))?;
let unversioned_libraries = s
- .split("\n")
+ .split('\n')
.take_while(|&line| !line.trim().is_empty())
- .filter_map(|line| line.trim_start().splitn(2, " ").nth(0));
+ .filter_map(|line| line.trim_start().split(' ').next());
let versioned_libraries = s
- .split("\n")
+ .split('\n')
.skip_while(|&line| !line.contains("Version information:"))
.skip(1)
.skip_while(|&line| !line.contains(path.to_str().unwrap()))
.skip(1)
.take_while(|&line| line.contains(" => "))
- .filter_map(|line| line.trim_start().splitn(2, " => ").nth(0));
+ .filter_map(|line| line.trim_start().split(" => ").next());
let marker = marker.unwrap_or_default();
let mut requires = BTreeSet::new();
@@ -98,22 +98,18 @@ fn find_requires_by_ldd(
{
if name.contains(" (") {
// Insert "unversioned" library name
- requires.insert(format!(
- "{}(){}",
- name.splitn(2, " ").nth(0).unwrap(),
- marker
- ));
- requires.insert(format!("{}{}", name.replace(" ", ""), marker));
+ requires.insert(format!("{}(){}", name.split(' ').next().unwrap(), marker));
+ requires.insert(format!("{}{}", name.replace(' ', ""), marker));
} else {
- requires.insert(format!("{}(){}", name.replace(" ", ""), marker));
+ requires.insert(format!("{}(){}", name.replace(' ', ""), marker));
}
}
Ok(requires)
}
fn find_requires_of_elf(path: &Path) -> Result