mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
chore(cli.rs): fix clippy warnings
This commit is contained in:
@@ -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> {
|
||||
¤t_dir()
|
||||
.expect("failed to read cwd")
|
||||
.join("**/package.json")
|
||||
.to_string_lossy()
|
||||
.into_owned(),
|
||||
.to_string_lossy(),
|
||||
)
|
||||
.unwrap()
|
||||
.filter_map(Result::ok)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
_ => {
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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)
|
||||
}) {
|
||||
|
||||
Reference in New Issue
Block a user