chore(cli.rs): fix clippy warnings

This commit is contained in:
Lucas Nogueira
2022-02-03 10:16:32 -03:00
parent 995de57a76
commit b1d7464d61
4 changed files with 9 additions and 8 deletions

View File

@@ -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)

View File

@@ -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);
}
_ => {

View File

@@ -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());

View File

@@ -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)
}) {