Browse Source

chore(cli.rs): fix clippy warnings

Lucas Nogueira 3 years ago
parent
commit
b1d7464d61

+ 1 - 3
tooling/cli.rs/src/helpers/app_paths.rs

@@ -12,7 +12,6 @@ fn get_tauri_dir() -> PathBuf {
       .expect("failed to read cwd")
       .join("**/tauri.conf.json")
       .to_string_lossy()
-      .into_owned(),
   )
   .unwrap()
   .filter_map(Result::ok)
@@ -26,8 +25,7 @@ fn get_app_dir() -> Option<PathBuf> {
     &current_dir()
       .expect("failed to read cwd")
       .join("**/package.json")
-      .to_string_lossy()
-      .into_owned(),
+      .to_string_lossy(),
   )
   .unwrap()
   .filter_map(Result::ok)

+ 3 - 3
tooling/cli.rs/src/helpers/manifest.rs

@@ -66,7 +66,7 @@ fn write_features(
         }
       }
     }
-    *manifest_features = Item::Value(Value::Array(toml_array(&features)));
+    *manifest_features = Item::Value(Value::Array(toml_array(features)));
     Ok(true)
   } else if let Some(dep) = item.as_value_mut() {
     match dep {
@@ -81,7 +81,7 @@ fn write_features(
             }
           }
         }
-        *manifest_features = Value::Array(toml_array(&features));
+        *manifest_features = Value::Array(toml_array(features));
       }
       Value::String(version) => {
         let mut def = InlineTable::default();
@@ -89,7 +89,7 @@ fn write_features(
           "version",
           version.to_string().replace('\"', "").replace(' ', ""),
         );
-        def.get_or_insert("features", Value::Array(toml_array(&features)));
+        def.get_or_insert("features", Value::Array(toml_array(features)));
         *dep = Value::InlineTable(def);
       }
       _ => {

+ 4 - 1
tooling/cli.rs/src/helpers/mod.rs

@@ -47,7 +47,10 @@ pub fn command_env(debug: bool) -> HashMap<String, String> {
   map.insert("TAURI_PLATFORM".into(), std::env::consts::OS.into());
   map.insert("TAURI_ARCH".into(), std::env::consts::ARCH.into());
   map.insert("TAURI_FAMILY".into(), std::env::consts::FAMILY.into());
-  map.insert("TAURI_PLATFORM_VERSION".into(), os_info::get().version().to_string());
+  map.insert(
+    "TAURI_PLATFORM_VERSION".into(),
+    os_info::get().version().to_string(),
+  );
 
   #[cfg(target_os = "linux")]
   map.insert("TAURI_PLATFORM_TYPE".into(), "Linux".into());

+ 1 - 1
tooling/cli.rs/src/interface/rust.rs

@@ -352,7 +352,7 @@ pub fn get_workspace_dir(current_dir: &Path) -> PathBuf {
           if let Some(workspace_settings) = cargo_settings.workspace {
             if let Some(members) = workspace_settings.members {
               if members.iter().any(|member| {
-                glob::glob(&dir.join(member).to_string_lossy().into_owned())
+                glob::glob(&dir.join(member).to_string_lossy())
                   .unwrap()
                   .any(|p| p.unwrap() == project_path)
               }) {