mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Stylo: replace uses of mem::uninitialized with MaybeUninit
MozReview-Commit-ID: KGhYL6DJRaR
This commit is contained in:
parent
00b3fb49c4
commit
17ec774a49
9 changed files with 60 additions and 68 deletions
|
@ -29,15 +29,15 @@ impl<'a> AutoProfilerLabel<'a> {
|
|||
/// stack.
|
||||
#[inline]
|
||||
pub unsafe fn new(
|
||||
label: &mut structs::AutoProfilerLabel,
|
||||
label: &mut std::mem::MaybeUninit<structs::AutoProfilerLabel>,
|
||||
label_type: ProfilerLabel,
|
||||
) -> AutoProfilerLabel {
|
||||
let category_pair = match label_type {
|
||||
ProfilerLabel::Style => structs::JS::ProfilingCategoryPair_LAYOUT_StyleComputation,
|
||||
ProfilerLabel::Parse => structs::JS::ProfilingCategoryPair_LAYOUT_CSSParsing,
|
||||
};
|
||||
structs::Gecko_Construct_AutoProfilerLabel(label, category_pair);
|
||||
AutoProfilerLabel(label)
|
||||
structs::Gecko_Construct_AutoProfilerLabel(label.as_mut_ptr(), category_pair);
|
||||
AutoProfilerLabel(&mut *label.as_mut_ptr())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue