clippy: Fix several warnings in components/devtools (#31501)

This commit is contained in:
eri 2024-03-05 19:19:04 +01:00 committed by GitHub
parent da873779b4
commit 3552bb2464
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 85 additions and 86 deletions

View file

@ -10,6 +10,7 @@
#![crate_name = "devtools"]
#![crate_type = "rlib"]
#![allow(non_snake_case)]
#![allow(clippy::too_many_arguments)]
#![deny(unsafe_code)]
use std::borrow::ToOwned;
@ -135,7 +136,7 @@ fn run_server(
port: u16,
embedder: EmbedderProxy,
) {
let bound = TcpListener::bind(&("0.0.0.0", port)).ok().and_then(|l| {
let bound = TcpListener::bind(("0.0.0.0", port)).ok().and_then(|l| {
l.local_addr()
.map(|addr| addr.port())
.ok()
@ -259,7 +260,7 @@ fn run_server(
Some(bc) => bc,
None => return,
};
let name = match browsing_contexts.get(&bc) {
let name = match browsing_contexts.get(bc) {
Some(name) => name,
None => return,
};
@ -299,7 +300,7 @@ fn run_server(
name: worker_name.clone(),
console: console_name.clone(),
thread: thread_name,
id: id,
id,
url: page_info.url.clone(),
type_: WorkerType::Dedicated,
script_chan: script_sender,
@ -324,7 +325,7 @@ fn run_server(
page_info,
pipeline,
script_sender,
&mut *actors,
&mut actors,
);
let name = browsing_context_actor.name();
browsing_contexts.insert(browsing_context, name.clone());
@ -366,7 +367,7 @@ fn run_server(
let actors = actors.lock().unwrap();
let console_actor = actors.find::<ConsoleActor>(&console_actor_name);
let id = worker_id.map_or(UniqueId::Pipeline(id), UniqueId::Worker);
console_actor.handle_page_error(page_error, id, &*actors);
console_actor.handle_page_error(page_error, id, &actors);
}
fn handle_console_message(
@ -392,7 +393,7 @@ fn run_server(
let actors = actors.lock().unwrap();
let console_actor = actors.find::<ConsoleActor>(&console_actor_name);
let id = worker_id.map_or(UniqueId::Pipeline(id), UniqueId::Worker);
console_actor.handle_console_api(console_message, id, &*actors);
console_actor.handle_console_api(console_message, id, &actors);
}
fn find_console_actor(