fix some pedantic lints
This commit is contained in:
+2
-1
@@ -25,6 +25,7 @@ fn get_arg_parser() -> Command<'static> {
|
||||
result
|
||||
}
|
||||
|
||||
pub fn get_args() -> clap::ArgMatches {
|
||||
#[must_use]
|
||||
pub fn get() -> clap::ArgMatches {
|
||||
get_arg_parser().get_matches()
|
||||
}
|
||||
|
||||
+4
-3
@@ -15,6 +15,7 @@ pub struct Pacdef {
|
||||
}
|
||||
|
||||
impl Pacdef {
|
||||
#[must_use]
|
||||
pub fn new(args: ArgMatches, groups: HashSet<Group>) -> Self {
|
||||
Self { args, groups }
|
||||
}
|
||||
@@ -62,7 +63,7 @@ impl Pacdef {
|
||||
return;
|
||||
};
|
||||
|
||||
to_install.install_missing_packages()
|
||||
to_install.install_missing_packages();
|
||||
}
|
||||
|
||||
fn edit_group_files(&self, groups: &ArgMatches) -> Result<()> {
|
||||
@@ -95,7 +96,7 @@ impl Pacdef {
|
||||
}
|
||||
|
||||
fn show_version(self) {
|
||||
println!("pacdef, version: {}", env!("CARGO_PKG_VERSION"))
|
||||
println!("pacdef, version: {}", env!("CARGO_PKG_VERSION"));
|
||||
}
|
||||
|
||||
fn show_unmanaged_packages(self) {
|
||||
@@ -147,7 +148,7 @@ impl Pacdef {
|
||||
|
||||
println!(" {}", backend.get_section());
|
||||
for package in packages {
|
||||
println!(" {}", package);
|
||||
println!(" {package}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ impl Group {
|
||||
let path = file.path();
|
||||
|
||||
let group =
|
||||
Group::try_from(&path).with_context(|| format!("reading group file {:?}", path))?;
|
||||
Group::try_from(&path).with_context(|| format!("reading group file {path:?}"))?;
|
||||
result.insert(group);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ use anyhow::{Context, Result};
|
||||
use pacdef::{args, Group, Pacdef};
|
||||
|
||||
fn main() -> Result<()> {
|
||||
let args = args::get_args();
|
||||
let args = args::get();
|
||||
let groups = Group::load_from_dir()?;
|
||||
let pacdef = Pacdef::new(args, groups);
|
||||
pacdef.run_action_from_arg().context("running action")
|
||||
|
||||
Reference in New Issue
Block a user