Skip to content

Commit

Permalink
Formatting.
Browse files Browse the repository at this point in the history
Signed-off-by: Josh Matthews <[email protected]>
  • Loading branch information
jdm committed Dec 25, 2024
1 parent b34a211 commit 2f26a0e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
5 changes: 3 additions & 2 deletions mozjs-sys/src/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use crate::glue::{
CallBigIntTracer, CallFunctionTracer, CallIdTracer, CallObjectTracer, CallScriptTracer,
CallStringTracer, CallSymbolTracer, CallValueRootTracer, CallValueTracer, CallPropertyDescriptorTracer
CallBigIntTracer, CallFunctionTracer, CallIdTracer, CallObjectTracer,
CallPropertyDescriptorTracer, CallScriptTracer, CallStringTracer, CallSymbolTracer,
CallValueRootTracer, CallValueTracer,
};
use crate::jsapi::js::TraceValueArray;
use crate::jsapi::JS::{PropertyDescriptor, Value};
Expand Down
2 changes: 1 addition & 1 deletion mozjs/src/gc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pub use crate::gc::collections::*;
pub use crate::gc::custom::*;
pub use crate::gc::root::*;
pub use crate::gc::trace::*;
pub use mozjs_sys::jsgc::{GCMethods, RootKind, Rootable, Initialize};
pub use mozjs_sys::jsgc::{GCMethods, Initialize, RootKind, Rootable};
pub use mozjs_sys::trace::Traceable;

mod collections;
Expand Down
15 changes: 9 additions & 6 deletions mozjs/tests/rootable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@

use std::ptr;

use mozjs::jsapi::{
GetRealmObjectPrototype, JS_NewGlobalObject, SetGCZeal,
};
use mozjs::jsapi::{JSAutoRealm, OnNewGlobalHookOption, Value, JSTracer};
use mozjs::jsapi::{GetRealmObjectPrototype, JS_NewGlobalObject, SetGCZeal};
use mozjs::jsapi::{JSAutoRealm, JSTracer, OnNewGlobalHookOption, Value};
use mozjs::jsval::ObjectValue;
use mozjs::rooted;
use mozjs::rust::{JSEngine, RealmOptions, Runtime, SIMPLE_GLOBAL_CLASS};
Expand All @@ -22,7 +20,9 @@ unsafe impl mozjs::gc::Traceable for ContainsGCValue {
}

impl mozjs::gc::Initialize for ContainsGCValue {
unsafe fn initial() -> Option<ContainsGCValue> { None }
unsafe fn initial() -> Option<ContainsGCValue> {
None
}
}

struct ContainsGCValue {
Expand Down Expand Up @@ -56,6 +56,9 @@ fn rooting() {
val: ObjectValue(prototype_proto.get())
}));
assert_eq!(some_container.val.to_object(), prototype_proto.get());
assert_eq!(some_container.val, some_optional_container.as_ref().unwrap().val);
assert_eq!(
some_container.val,
some_optional_container.as_ref().unwrap().val
);
}
}

0 comments on commit 2f26a0e

Please sign in to comment.