From: Ian Jackson Date: Thu, 31 Mar 2022 01:52:58 +0000 (+0100) Subject: clippy: Miscellaneous minor changes X-Git-Tag: otter-1.0.0~39 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=8f575026d516ba349bb3d23b139790aee5a15738;p=otter.git clippy: Miscellaneous minor changes Signed-off-by: Ian Jackson --- diff --git a/src/shapelib.rs b/src/shapelib.rs index a33477ba..4e8ef438 100644 --- a/src/shapelib.rs +++ b/src/shapelib.rs @@ -969,7 +969,7 @@ impl Config1 { } #[throws(LibraryLoadError)] -pub fn load_global_libs(libs: &Vec) { +pub fn load_global_libs(libs: &[Config1]) { for l in libs { let libs = l.resolve()?; let n = libs.len(); @@ -1107,7 +1107,7 @@ impl TryFrom for FileList { let mut xfields = Vec::new(); for (lno,l) in s.lines().enumerate() { let l = l.trim(); - if l=="" || l.starts_with("#") { continue } + if l=="" || l.starts_with('#') { continue } if let Some(xfields_spec) = l.strip_prefix(':') { if ! (o.is_empty() && xfields.is_empty()) { throw!(LLE::FilesListFieldsMustBeAtStart(lno)); @@ -1129,7 +1129,7 @@ impl TryFrom for FileList { let item_spec = n()?; let src_file_spec = n()?; let extra_fields = xfields.iter() - .map(|field| Ok::<_,LLE>((field.to_owned(), n()?.to_owned()))) + .map(|field| Ok::<_,LLE>((field.to_owned(), n()?))) .collect::>()?; let desc = remain.to_owned(); o.push(FileData{ item_spec, src_file_spec, extra_fields, desc }); diff --git a/src/spec.rs b/src/spec.rs index 30f11487..20f63fbf 100644 --- a/src/spec.rs +++ b/src/spec.rs @@ -523,7 +523,7 @@ pub mod imp { unix_user: user, common, }; - command.args(&["-f", &user]); + command.args(&["-f", user]); nwtemplates::render("token-unix.tera", &data) } _ => {