refactor: impl method returns Self

This commit is contained in:
EdJoPaTo
2021-04-01 09:05:05 +02:00
parent d5798982d1
commit cf31797e86
4 changed files with 26 additions and 26 deletions
+4 -4
View File
@@ -9,15 +9,15 @@ pub struct StatefulTree<'a> {
impl<'a> StatefulTree<'a> {
#[allow(dead_code)]
pub fn new() -> StatefulTree<'a> {
StatefulTree {
pub fn new() -> Self {
Self {
state: TreeState::default(),
items: Vec::new(),
}
}
pub fn with_items(items: Vec<TreeItem<'a>>) -> StatefulTree<'a> {
StatefulTree {
pub fn with_items(items: Vec<TreeItem<'a>>) -> Self {
Self {
state: TreeState::default(),
items,
}