refactor(item): use keyword Self
This commit is contained in:
+2
-6
@@ -65,11 +65,7 @@ where
|
|||||||
/// # Errors
|
/// # Errors
|
||||||
///
|
///
|
||||||
/// Errors when there are duplicate identifiers in the children.
|
/// Errors when there are duplicate identifiers in the children.
|
||||||
pub fn new<T>(
|
pub fn new<T>(identifier: Identifier, text: T, children: Vec<Self>) -> std::io::Result<Self>
|
||||||
identifier: Identifier,
|
|
||||||
text: T,
|
|
||||||
children: Vec<TreeItem<'a, Identifier>>,
|
|
||||||
) -> std::io::Result<Self>
|
|
||||||
where
|
where
|
||||||
T: Into<Text<'a>>,
|
T: Into<Text<'a>>,
|
||||||
{
|
{
|
||||||
@@ -127,7 +123,7 @@ where
|
|||||||
/// # Errors
|
/// # Errors
|
||||||
///
|
///
|
||||||
/// Errors when the `identifier` of the `child` already exists in the children.
|
/// Errors when the `identifier` of the `child` already exists in the children.
|
||||||
pub fn add_child(&mut self, child: TreeItem<'a, Identifier>) -> std::io::Result<()> {
|
pub fn add_child(&mut self, child: Self) -> std::io::Result<()> {
|
||||||
let existing = self
|
let existing = self
|
||||||
.children
|
.children
|
||||||
.iter()
|
.iter()
|
||||||
|
|||||||
Reference in New Issue
Block a user