mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
clippy: Rename various methods and members to conform to naming guidelines (#33762)
This ensure that methods named `new()` do not take `&self` or return `Box<Self>`. In addition, method are renamed (or removed when not necessary) to avoid being prefixed with `from_`. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
2805d3ce14
commit
6f87c38cda
6 changed files with 55 additions and 57 deletions
|
@ -47,6 +47,33 @@ pub struct WorkletGlobalScope {
|
|||
}
|
||||
|
||||
impl WorkletGlobalScope {
|
||||
/// Create a new heap-allocated `WorkletGlobalScope`.
|
||||
pub fn new(
|
||||
scope_type: WorkletGlobalScopeType,
|
||||
runtime: &Runtime,
|
||||
pipeline_id: PipelineId,
|
||||
base_url: ServoUrl,
|
||||
executor: WorkletExecutor,
|
||||
init: &WorkletGlobalScopeInit,
|
||||
) -> DomRoot<WorkletGlobalScope> {
|
||||
match scope_type {
|
||||
WorkletGlobalScopeType::Test => DomRoot::upcast(TestWorkletGlobalScope::new(
|
||||
runtime,
|
||||
pipeline_id,
|
||||
base_url,
|
||||
executor,
|
||||
init,
|
||||
)),
|
||||
WorkletGlobalScopeType::Paint => DomRoot::upcast(PaintWorkletGlobalScope::new(
|
||||
runtime,
|
||||
pipeline_id,
|
||||
base_url,
|
||||
executor,
|
||||
init,
|
||||
)),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a new stack-allocated `WorkletGlobalScope`.
|
||||
pub fn new_inherited(
|
||||
pipeline_id: PipelineId,
|
||||
|
@ -178,35 +205,6 @@ pub enum WorkletGlobalScopeType {
|
|||
Paint,
|
||||
}
|
||||
|
||||
impl WorkletGlobalScopeType {
|
||||
/// Create a new heap-allocated `WorkletGlobalScope`.
|
||||
pub fn new(
|
||||
&self,
|
||||
runtime: &Runtime,
|
||||
pipeline_id: PipelineId,
|
||||
base_url: ServoUrl,
|
||||
executor: WorkletExecutor,
|
||||
init: &WorkletGlobalScopeInit,
|
||||
) -> DomRoot<WorkletGlobalScope> {
|
||||
match *self {
|
||||
WorkletGlobalScopeType::Test => DomRoot::upcast(TestWorkletGlobalScope::new(
|
||||
runtime,
|
||||
pipeline_id,
|
||||
base_url,
|
||||
executor,
|
||||
init,
|
||||
)),
|
||||
WorkletGlobalScopeType::Paint => DomRoot::upcast(PaintWorkletGlobalScope::new(
|
||||
runtime,
|
||||
pipeline_id,
|
||||
base_url,
|
||||
executor,
|
||||
init,
|
||||
)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A task which can be performed in the context of a worklet global.
|
||||
pub enum WorkletTask {
|
||||
Test(TestWorkletTask),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue