Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Better method ordering

Conrad Irwinbaa16a2fc6d2
diff --git a/crates/workspace/src/status_bar.rs b/crates/workspace/src/status_bar.rs
index 7b1c11dcf25..8c3cfe20532 100644
--- a/crates/workspace/src/status_bar.rs
+++ b/crates/workspace/src/status_bar.rs
@@ -96,13 +96,6 @@ impl StatusBar {
cx.notify();
}
- pub fn position_of_item<T>(&self) -> Option<usize>
- where
- T: StatusItemView,
- {
- self.position_of_named_item(T::ui_name())
- }
-
pub fn item_of_type<T: StatusItemView>(&self) -> Option<ViewHandle<T>> {
self.left_items
.iter()
@@ -110,6 +103,13 @@ impl StatusBar {
.find_map(|item| item.as_any().clone().downcast())
}
+ pub fn position_of_item<T>(&self) -> Option<usize>
+ where
+ T: StatusItemView,
+ {
+ self.position_of_named_item(T::ui_name())
+ }
+
pub fn position_of_named_item(&self, name: &str) -> Option<usize> {
for (index, item) in self.left_items.iter().enumerate() {
if item.as_ref().ui_name() == name {