core: Slightly neater way to get root_mc in context_menu.rs

This commit is contained in:
Nathan Adams 2023-03-15 09:15:04 +01:00
parent c116f29821
commit 9e6a1f3234
1 changed files with 1 additions and 3 deletions

View File

@ -34,9 +34,7 @@ impl<'gc> ContextMenuState<'gc> {
&self.callbacks[index] &self.callbacks[index]
} }
pub fn build_builtin_items(&mut self, item_flags: BuiltInItemFlags, stage: Stage<'gc>) { pub fn build_builtin_items(&mut self, item_flags: BuiltInItemFlags, stage: Stage<'gc>) {
let root_mc = if let Some(root_clip) = stage.root_clip().and_then(|c| c.as_movie_clip()) { let Some(root_mc) = stage.root_clip().and_then(|c| c.as_movie_clip()) else {
root_clip
} else {
return; return;
}; };
if item_flags.play { if item_flags.play {