DevTools: Replace camel case variable names (#32726)

* refactor: rename to snake case

* refactor: more renaming

* chore: format

* chore: clean
This commit is contained in:
eri 2024-07-08 13:18:35 +02:00 committed by GitHub
parent b243457ccc
commit 2888193cfe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 363 additions and 323 deletions

View file

@ -41,12 +41,12 @@ impl WorkerActor {
pub(crate) fn encodable(&self) -> WorkerMsg {
WorkerMsg {
actor: self.name.clone(),
consoleActor: self.console.clone(),
threadActor: self.thread.clone(),
console_actor: self.console.clone(),
thread_actor: self.thread.clone(),
id: self.id.0.to_string(),
url: self.url.to_string(),
traits: WorkerTraits {
isParentInterceptEnabled: false,
is_parent_intercept_enabled: false,
},
type_: self.type_ as u32,
}
@ -89,8 +89,8 @@ impl Actor for WorkerActor {
let msg = ConnectReply {
from: self.name(),
type_: "connected".to_owned(),
threadActor: self.thread.clone(),
consoleActor: self.console.clone(),
thread_actor: self.thread.clone(),
console_actor: self.console.clone(),
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
@ -136,24 +136,27 @@ struct AttachedReply {
}
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
struct ConnectReply {
from: String,
#[serde(rename = "type")]
type_: String,
threadActor: String,
consoleActor: String,
thread_actor: String,
console_actor: String,
}
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
struct WorkerTraits {
isParentInterceptEnabled: bool,
is_parent_intercept_enabled: bool,
}
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct WorkerMsg {
actor: String,
consoleActor: String,
threadActor: String,
console_actor: String,
thread_actor: String,
id: String,
url: String,
traits: WorkerTraits,