Better method ordering

This commit is contained in:
Conrad Irwin 2023-07-24 09:57:51 -06:00
parent 43d94e37ec
commit baa16a2fc6

View file

@ -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 {