mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Remove transmutes in LayoutContext.
This commit is contained in:
parent
d9751c0fbb
commit
f8785beb24
1 changed files with 6 additions and 6 deletions
|
@ -99,24 +99,24 @@ impl<'a> LayoutContext<'a> {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn font_context<'a>(&'a self) -> &'a mut FontContext {
|
pub fn font_context<'a>(&'a self) -> &'a mut FontContext {
|
||||||
unsafe {
|
unsafe {
|
||||||
let cached_context = &*self.cached_local_layout_context;
|
let cached_context = &mut *self.cached_local_layout_context;
|
||||||
mem::transmute(&cached_context.font_context)
|
&mut cached_context.font_context
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn applicable_declarations_cache<'a>(&'a self) -> &'a mut ApplicableDeclarationsCache {
|
pub fn applicable_declarations_cache<'a>(&'a self) -> &'a mut ApplicableDeclarationsCache {
|
||||||
unsafe {
|
unsafe {
|
||||||
let cached_context = &*self.cached_local_layout_context;
|
let cached_context = &mut *self.cached_local_layout_context;
|
||||||
mem::transmute(&cached_context.applicable_declarations_cache)
|
&mut cached_context.applicable_declarations_cache
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn style_sharing_candidate_cache<'a>(&'a self) -> &'a mut StyleSharingCandidateCache {
|
pub fn style_sharing_candidate_cache<'a>(&'a self) -> &'a mut StyleSharingCandidateCache {
|
||||||
unsafe {
|
unsafe {
|
||||||
let cached_context = &*self.cached_local_layout_context;
|
let cached_context = &mut *self.cached_local_layout_context;
|
||||||
mem::transmute(&cached_context.style_sharing_candidate_cache)
|
&mut cached_context.style_sharing_candidate_cache
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue