mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Remove uses of &mut JSRef
Since everything with JSRef happens with interior mutability, it doesn't make any sense to use an &mut JSRef.
This commit is contained in:
parent
5e5f77a354
commit
176b3f7698
2 changed files with 1 additions and 14 deletions
|
@ -5478,24 +5478,11 @@ class GlobalGenRoots():
|
|||
}
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn to_mut_ref<'a, 'b, T: ${toBound}+Reflectable>(base: &'a mut JSRef<'b, T>) -> Option<&'a mut JSRef<'b, Self>> {
|
||||
match base.deref().${checkFn}() {
|
||||
true => unsafe { Some(base.transmute_mut()) },
|
||||
false => None
|
||||
}
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn from_ref<'a, 'b, T: ${fromBound}>(derived: &'a JSRef<'b, T>) -> &'a JSRef<'b, Self> {
|
||||
unsafe { derived.transmute() }
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn from_mut_ref<'a, 'b, T: ${fromBound}>(derived: &'a mut JSRef<'b, T>) -> &'a mut JSRef<'b, Self> {
|
||||
unsafe { derived.transmute_mut() }
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn from_temporary<T: ${fromBound}+Reflectable>(derived: Temporary<T>) -> Temporary<Self> {
|
||||
unsafe { derived.transmute() }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue