Update rustfmt to the 2024 style edition (#35764)

* Use 2024 style edition

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Reformat all code

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2025-03-03 12:26:53 +01:00 committed by GitHub
parent 6300e820b4
commit 3d320fa96a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
603 changed files with 1739 additions and 1648 deletions

View file

@ -9,8 +9,8 @@ use std::ffi::CStr;
use js::jsapi::{JSPROP_ENUMERATE, JSPROP_PERMANENT, JSPROP_READONLY};
use js::jsval::{BooleanValue, DoubleValue, Int32Value, JSVal, NullValue, UInt32Value};
use js::rooted;
use js::rust::wrappers::JS_DefineProperty;
use js::rust::HandleObject;
use js::rust::wrappers::JS_DefineProperty;
use crate::script_runtime::JSContext;

View file

@ -5,7 +5,7 @@
use std::{ptr, slice};
use js::conversions::{
latin1_to_string, ConversionResult, FromJSValConvertible, ToJSValConvertible,
ConversionResult, FromJSValConvertible, ToJSValConvertible, latin1_to_string,
};
use js::error::throw_type_error;
use js::glue::{
@ -13,13 +13,13 @@ use js::glue::{
JS_GetReservedSlot, UnwrapObjectDynamic,
};
use js::jsapi::{
JSContext, JSObject, JSString, JS_DeprecatedStringHasLatin1Chars,
JS_GetLatin1StringCharsAndLength, JS_GetTwoByteStringCharsAndLength, JS_NewStringCopyN,
JS_DeprecatedStringHasLatin1Chars, JS_GetLatin1StringCharsAndLength,
JS_GetTwoByteStringCharsAndLength, JS_NewStringCopyN, JSContext, JSObject, JSString,
};
use js::jsval::{ObjectValue, StringValue, UndefinedValue};
use js::rust::{
get_object_class, is_dom_class, is_dom_object, maybe_wrap_value, HandleValue,
MutableHandleValue, ToString,
HandleValue, MutableHandleValue, ToString, get_object_class, is_dom_class, is_dom_object,
maybe_wrap_value,
};
use crate::inheritance::Castable;

View file

@ -6,7 +6,7 @@
use std::mem;
use crate::conversions::{get_dom_class, DerivedFrom, IDLInterface};
use crate::conversions::{DerivedFrom, IDLInterface, get_dom_class};
use crate::reflector::DomObject;
use crate::script_runtime::runtime_is_alive;

View file

@ -16,14 +16,14 @@ use std::ops::Drop;
use std::{mem, ptr};
use js::glue::JS_GetReservedSlot;
use js::jsapi::{JSTracer, JS_SetReservedSlot};
use js::jsapi::{JS_SetReservedSlot, JSTracer};
use js::jsval::{PrivateValue, UndefinedValue};
use libc::c_void;
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
use crate::JSTraceable;
use crate::reflector::DomObject;
use crate::root::DomRoot;
use crate::JSTraceable;
/// The index of the slot wherein a pointer to the weak holder cell is
/// stored for weak-referenceable bindings. We use slot 1 for holding it,
@ -70,8 +70,7 @@ pub trait WeakReferenceable: DomObject + Sized {
let new_count = box_.count.get() + 1;
trace!(
"Incrementing WeakBox refcount for {:p} to {}.",
self,
new_count
self, new_count
);
box_.count.set(new_count);
WeakRef {