diff --git a/crates/file_finder/src/file_finder.rs b/crates/file_finder/src/file_finder.rs index 0a8513332c..9e1a6d479c 100644 --- a/crates/file_finder/src/file_finder.rs +++ b/crates/file_finder/src/file_finder.rs @@ -76,7 +76,8 @@ impl View for FileFinder { Container::new( Flex::new(Axis::Vertical) .with_child( - ChildView::new(&self.query_editor).contained() + ChildView::new(&self.query_editor) + .contained() .with_style(settings.theme.selector.input_editor.container) .boxed(), ) diff --git a/crates/theme_selector/src/theme_selector.rs b/crates/theme_selector/src/theme_selector.rs index 11fbe35935..8483fa4e8a 100644 --- a/crates/theme_selector/src/theme_selector.rs +++ b/crates/theme_selector/src/theme_selector.rs @@ -218,7 +218,8 @@ impl ThemeSelector { )) }; - self.selected_index = self.selected_index + self.selected_index = self + .selected_index .min(self.matches.len().saturating_sub(1)); cx.notify(); @@ -341,7 +342,8 @@ impl View for ThemeSelector { Container::new( Flex::new(Axis::Vertical) .with_child( - ChildView::new(&self.query_editor).contained() + ChildView::new(&self.query_editor) + .contained() .with_style(settings.theme.selector.input_editor.container) .boxed(), ) diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index 4e057fa6bc..f06a244c05 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -755,7 +755,11 @@ impl Workspace { } // Returns the model that was toggled closed if it was open - pub fn toggle_modal(&mut self, cx: &mut ViewContext, add_view: F) -> Option> + pub fn toggle_modal( + &mut self, + cx: &mut ViewContext, + add_view: F, + ) -> Option> where V: 'static + View, F: FnOnce(&mut ViewContext, &mut Self) -> ViewHandle, @@ -763,8 +767,7 @@ impl Workspace { cx.notify(); // Whatever modal was visible is getting clobbered. If its the same type as V, then return // it. Otherwise, create a new modal and set it as active. - let already_open_modal = self.modal.take() - .and_then(|modal| modal.downcast::()); + let already_open_modal = self.modal.take().and_then(|modal| modal.downcast::()); if let Some(already_open_modal) = already_open_modal { cx.focus_self(); Some(already_open_modal)