Browse Source

chore(lint): fix warnings

Lucas Nogueira 3 năm trước cách đây
mục cha
commit
0ea009cfdc
2 tập tin đã thay đổi với 3 bổ sung4 xóa
  1. 2 4
      core/tauri/src/lib.rs
  2. 1 0
      core/tauri/src/manager.rs

+ 2 - 4
core/tauri/src/lib.rs

@@ -813,9 +813,7 @@ mod tests {
   fn get_manifest() -> &'static Manifest {
     MANIFEST.get_or_init(|| {
       let manifest_dir = PathBuf::from(var("CARGO_MANIFEST_DIR").unwrap());
-      let manifest = Manifest::from_path(manifest_dir.join("Cargo.toml"))
-        .expect("failed to parse Cargo manifest");
-      manifest
+      Manifest::from_path(manifest_dir.join("Cargo.toml")).expect("failed to parse Cargo manifest")
     })
   }
 
@@ -824,7 +822,7 @@ mod tests {
     let manifest_dir = PathBuf::from(var("CARGO_MANIFEST_DIR").unwrap());
     let lib_code = read_to_string(manifest_dir.join("src/lib.rs")).expect("failed to read lib.rs");
 
-    for (f, _) in &get_manifest().features {
+    for f in get_manifest().features.keys() {
       if !(f.starts_with("__") || f == "default" || lib_code.contains(&format!("*{}**", f))) {
         panic!("Feature {} is not documented", f);
       }

+ 1 - 0
core/tauri/src/manager.rs

@@ -1390,6 +1390,7 @@ mod tests {
   #[test]
   fn string_replace_with_callback() {
     let mut tauri_index = 0;
+    #[allow(clippy::single_element_loop)]
     for (src, pattern, replacement, result) in [(
       "tauri is awesome, tauri is amazing",
       "tauri",