Stylo: replace uses of mem::uninitialized with MaybeUninit

MozReview-Commit-ID: KGhYL6DJRaR
This commit is contained in:
Simon Sapin 2019-07-06 18:16:30 +02:00
parent 00b3fb49c4
commit 17ec774a49
9 changed files with 60 additions and 68 deletions

View file

@ -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())
}
}