chore: apply some clippy suggestions (#13424)

This commit is contained in:
Tony
2025-05-13 14:18:24 +08:00
committed by GitHub
parent d3586a2afa
commit 1777406a16
5 changed files with 6 additions and 10 deletions

View File

@@ -193,7 +193,7 @@ fn bundle_update_windows(settings: &Settings, bundles: &[Bundle]) -> crate::Resu
p.push(c);
(p, b)
});
let archived_path = archived_path.with_extension(format!("{}.zip", bundle_name));
let archived_path = archived_path.with_extension(format!("{bundle_name}.zip"));
log::info!(action = "Bundling"; "{}", display_path(&archived_path));

View File

@@ -4858,10 +4858,9 @@ You may have it installed on another user account, but it is not available for t
.unwrap();
unsafe {
let label_ = label.clone();
let focused_webview_ = focused_webview.clone();
controller.add_LostFocus(
&FocusChangedEventHandler::create(Box::new(move |_, _| {
let mut focused_webview = focused_webview_.lock().unwrap();
let mut focused_webview = focused_webview.lock().unwrap();
// when using multiwebview mode, we should handle webview focus changes
// so we check is the currently focused webview matches this webview's
// (in this case, it means we lost the window focus)

View File

@@ -393,12 +393,12 @@ fn define_permissions(
};
let default_toml = format!(
r###"{LICENSE_HEADER}# Automatically generated - DO NOT EDIT!
r#"{LICENSE_HEADER}# Automatically generated - DO NOT EDIT!
[default]
description = "Default permissions for the plugin{all_enable_by_default}."
permissions = [{default_permissions}]
"###,
"#,
);
let out_path = autogenerated.join("default.toml");

View File

@@ -276,7 +276,7 @@ impl<R: Runtime> AppManager<R> {
) -> Self {
// generate a random isolation key at runtime
#[cfg(feature = "isolation")]
if let Pattern::Isolation { ref mut key, .. } = &mut context.pattern {
if let Pattern::Isolation { key, .. } = &mut context.pattern {
*key = uuid::Uuid::new_v4().to_string();
}

View File

@@ -80,10 +80,7 @@ pub fn restart(env: &Env) -> ! {
#[cfg(target_os = "macos")]
restart_macos_app(&path, env);
if let Err(e) = Command::new(path)
.args(env.args_os.iter().skip(1).collect::<Vec<_>>())
.spawn()
{
if let Err(e) = Command::new(path).args(env.args_os.iter().skip(1)).spawn() {
log::error!("failed to restart app: {e}");
}
}