Use ViewExt.title() in TabView
Instead of storing a separate copy of the view title. Additionally, rename `ViewExt.set_title()` to `ViewExt.with_title()` as it consumes `self` and returns ownership.
This commit is contained in:
@@ -75,8 +75,8 @@ impl<I: ListItem> ListView<I> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_title(mut self, title: String) -> Self {
|
||||
self.title = title;
|
||||
pub fn with_title(mut self, title: &str) -> Self {
|
||||
self.title = title.to_string();
|
||||
self
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user