chore: fix some clippy warnings

This commit is contained in:
Lucas Nogueira
2022-01-06 10:39:21 -03:00
parent 3dddce5436
commit c7621aa019
4 changed files with 3 additions and 5 deletions

View File

@@ -2875,8 +2875,6 @@ fn handle_gl_loop(
windows,
window_event_listeners,
menu_event_listeners,
#[cfg(feature = "system-tray")]
tray_context,
..
} = context;
let egui_id = EGUI_ID.lock().unwrap();

View File

@@ -37,7 +37,7 @@ fn register_shortcut<R: Runtime>(
) -> crate::Result<()> {
let accelerator = shortcut.clone();
manager.register(&shortcut, move || {
let callback_string = crate::api::rpc::format_callback(handler.to_string(), &accelerator)
let callback_string = crate::api::rpc::format_callback(&handler, &accelerator)
.expect("unable to serialize shortcut string to json");
let _ = window.eval(callback_string.as_str());
})?;

View File

@@ -320,7 +320,7 @@ impl<R: Runtime> WindowManager<R> {
)
};
pending.register_uri_scheme_protocol("asset", move |request| {
let parsed_path = Url::parse(&request.uri())?;
let parsed_path = Url::parse(request.uri())?;
let filtered_path = &parsed_path[..Position::AfterPath];
#[cfg(target_os = "windows")]
let path = filtered_path.replace("asset://localhost/", "");

View File

@@ -781,7 +781,7 @@ fn default_archive_name_by_os() -> String {
// Convert base64 to string and prevent failing
fn base64_to_string(base64_string: &str) -> Result<String> {
let decoded_string = &decode(base64_string.to_owned())?;
let decoded_string = &decode(base64_string)?;
let result = from_utf8(decoded_string)?.to_string();
Ok(result)
}