refactor(item): use keyword Self

This commit is contained in:
EdJoPaTo
2024-03-23 10:07:55 +01:00
parent 68d19b0a58
commit 37ade72330
+2 -6
View File
@@ -65,11 +65,7 @@ where
/// # Errors
///
/// Errors when there are duplicate identifiers in the children.
pub fn new<T>(
identifier: Identifier,
text: T,
children: Vec<TreeItem<'a, Identifier>>,
) -> std::io::Result<Self>
pub fn new<T>(identifier: Identifier, text: T, children: Vec<Self>) -> std::io::Result<Self>
where
T: Into<Text<'a>>,
{
@@ -127,7 +123,7 @@ where
/// # Errors
///
/// 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
.children
.iter()