mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
clippy: Fix several warnings in components/script/dom/bindings
(#31945)
* clippy: fix several warnings in components/script/dom/bindings * fix: allow non_canonical_clone_impl in components/script/dom/bindings * chore: removed unnecessary curly braces * fix: removed vtable_address_comparisons allow
This commit is contained in:
parent
03b752289e
commit
37cf4cf207
4 changed files with 6 additions and 5 deletions
|
@ -418,7 +418,7 @@ where
|
||||||
/// without causing conflicts , unexpected behavior.
|
/// without causing conflicts , unexpected behavior.
|
||||||
/// <https://github.com/servo/mozjs/blob/main/mozjs-sys/mozjs/js/public/ArrayBuffer.h#L89>
|
/// <https://github.com/servo/mozjs/blob/main/mozjs-sys/mozjs/js/public/ArrayBuffer.h#L89>
|
||||||
unsafe extern "C" fn free_func(_contents: *mut c_void, free_user_data: *mut c_void) {
|
unsafe extern "C" fn free_func(_contents: *mut c_void, free_user_data: *mut c_void) {
|
||||||
let _ = Arc::from_raw(free_user_data as _);
|
let _ = Arc::from_raw(free_user_data as *const _);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
|
@ -165,7 +165,7 @@ pub unsafe fn create_global_object(
|
||||||
let private_val = PrivateValue(private);
|
let private_val = PrivateValue(private);
|
||||||
JS_SetReservedSlot(rval.get(), DOM_OBJECT_SLOT, &private_val);
|
JS_SetReservedSlot(rval.get(), DOM_OBJECT_SLOT, &private_val);
|
||||||
let proto_array: Box<ProtoOrIfaceArray> =
|
let proto_array: Box<ProtoOrIfaceArray> =
|
||||||
Box::new([0 as *mut JSObject; PrototypeList::PROTO_OR_IFACE_LENGTH]);
|
Box::new([ptr::null_mut::<JSObject>(); PrototypeList::PROTO_OR_IFACE_LENGTH]);
|
||||||
let val = PrivateValue(Box::into_raw(proto_array) as *const libc::c_void);
|
let val = PrivateValue(Box::into_raw(proto_array) as *const libc::c_void);
|
||||||
JS_SetReservedSlot(rval.get(), DOM_PROTOTYPE_SLOT, &val);
|
JS_SetReservedSlot(rval.get(), DOM_PROTOTYPE_SLOT, &val);
|
||||||
|
|
||||||
|
|
|
@ -563,13 +563,13 @@ pub unsafe fn cross_origin_set(
|
||||||
|
|
||||||
unsafe fn get_getter_object(d: &PropertyDescriptor, out: RawMutableHandleObject) {
|
unsafe fn get_getter_object(d: &PropertyDescriptor, out: RawMutableHandleObject) {
|
||||||
if d.hasGetter_() {
|
if d.hasGetter_() {
|
||||||
out.set(std::mem::transmute(d.getter_));
|
out.set(d.getter_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe fn get_setter_object(d: &PropertyDescriptor, out: RawMutableHandleObject) {
|
unsafe fn get_setter_object(d: &PropertyDescriptor, out: RawMutableHandleObject) {
|
||||||
if d.hasSetter_() {
|
if d.hasSetter_() {
|
||||||
out.set(std::mem::transmute(d.setter_));
|
out.set(d.setter_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -520,9 +520,10 @@ impl<T> Clone for Dom<T> {
|
||||||
|
|
||||||
impl<T> Clone for LayoutDom<'_, T> {
|
impl<T> Clone for LayoutDom<'_, T> {
|
||||||
#[inline]
|
#[inline]
|
||||||
|
#[allow(clippy::non_canonical_clone_impl)]
|
||||||
fn clone(&self) -> Self {
|
fn clone(&self) -> Self {
|
||||||
assert_in_layout();
|
assert_in_layout();
|
||||||
LayoutDom { value: self.value }
|
*self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue