chiark / gitweb /
clippy: Miscellaneous minor changes
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 31 Mar 2022 01:52:58 +0000 (02:52 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 31 Mar 2022 01:52:58 +0000 (02:52 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/shapelib.rs
src/spec.rs

index a33477ba23095e822d1d800de3cfe22963948c6a..4e8ef4382db35a8753bdef9acc7dc2f25fd87fde 100644 (file)
@@ -969,7 +969,7 @@ impl Config1 {
 }
 
 #[throws(LibraryLoadError)]
-pub fn load_global_libs(libs: &Vec<Config1>) {
+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<String> 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<String> 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::<Result<_,_>>()?;
       let desc = remain.to_owned();
       o.push(FileData{ item_spec, src_file_spec, extra_fields, desc });
index 30f11487ad8b7245d28fdbe6c739b0fd6fa943cd..20f63fbf5fcf66771d037c5fa475c0103c4c55b2 100644 (file)
@@ -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)
         }
         _ => {