mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
clippy: Fix several warnings (#31710)
Signed-off-by: RustAndMetal <111676747+RustAndMetal@users.noreply.github.com>
This commit is contained in:
parent
1ab8fa2895
commit
f6a975fc58
23 changed files with 75 additions and 86 deletions
|
@ -76,7 +76,7 @@ where
|
|||
{
|
||||
let heap_buffer_source = match init {
|
||||
HeapTypedArrayInit::Buffer(buffer_source) => HeapBufferSource {
|
||||
buffer_source: buffer_source,
|
||||
buffer_source,
|
||||
phantom: PhantomData::default(),
|
||||
},
|
||||
HeapTypedArrayInit::Info { len, cx } => {
|
||||
|
|
|
@ -253,9 +253,9 @@ impl CallSetup {
|
|||
let ais = callback.incumbent().map(AutoIncumbentScript::new);
|
||||
CallSetup {
|
||||
exception_global: global,
|
||||
cx: cx,
|
||||
cx,
|
||||
old_realm: unsafe { EnterRealm(*cx, callback.callback()) },
|
||||
handling: handling,
|
||||
handling,
|
||||
entry_script: Some(aes),
|
||||
incumbent_script: ais,
|
||||
}
|
||||
|
|
|
@ -22,10 +22,7 @@ pub struct Guard<T: Clone + Copy> {
|
|||
impl<T: Clone + Copy> Guard<T> {
|
||||
/// Construct a new guarded value.
|
||||
pub const fn new(condition: Condition, value: T) -> Self {
|
||||
Guard {
|
||||
condition: condition,
|
||||
value: value,
|
||||
}
|
||||
Guard { condition, value }
|
||||
}
|
||||
|
||||
/// Expose the value if the condition is satisfied.
|
||||
|
|
|
@ -76,8 +76,8 @@ impl NonCallbackInterfaceObjectClass {
|
|||
ext: 0 as *const _,
|
||||
oOps: &OBJECT_OPS,
|
||||
},
|
||||
proto_id: proto_id,
|
||||
proto_depth: proto_depth,
|
||||
proto_id,
|
||||
proto_depth,
|
||||
representation: string_rep,
|
||||
}
|
||||
}
|
||||
|
@ -649,10 +649,8 @@ pub fn get_desired_proto(
|
|||
let global = GetNonCCWObjectGlobal(*new_target);
|
||||
let proto_or_iface_cache = get_proto_or_iface_array(global);
|
||||
desired_proto.set((*proto_or_iface_cache)[proto_id as usize]);
|
||||
if &*new_target != &*original_new_target {
|
||||
if !JS_WrapObject(*cx, desired_proto.into()) {
|
||||
return Err(());
|
||||
}
|
||||
if &*new_target != &*original_new_target && !JS_WrapObject(*cx, desired_proto.into()) {
|
||||
return Err(());
|
||||
}
|
||||
return Ok(());
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ impl<T: DomObjectIteratorWrap + JSTraceable + Iterable> IterableIterator<T> {
|
|||
pub fn new(iterable: &T, type_: IteratorType) -> DomRoot<Self> {
|
||||
let iterator = Box::new(IterableIterator {
|
||||
reflector: Reflector::new(),
|
||||
type_: type_,
|
||||
type_,
|
||||
iterable: Dom::from_ref(iterable),
|
||||
index: Cell::new(0),
|
||||
});
|
||||
|
|
|
@ -163,7 +163,7 @@ where
|
|||
map.insert(key, property);
|
||||
}
|
||||
|
||||
Ok(ConversionResult::Success(Record { map: map }))
|
||||
Ok(ConversionResult::Success(Record { map }))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue