From 6e66e3e398025bb8b42ab8c12585b31861214685 Mon Sep 17 00:00:00 2001 From: Alex Clarke Date: Mon, 11 Nov 2024 18:00:49 -0700 Subject: [PATCH] feat: Added the ability to get the text of any given TreeItem --- src/tree_item.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tree_item.rs b/src/tree_item.rs index 37d706d..130b6f2 100644 --- a/src/tree_item.rs +++ b/src/tree_item.rs @@ -90,6 +90,12 @@ where &self.identifier } + /// Get a reference to the text. + #[must_use] + pub const fn text(&self) -> &Text<'text> { + &self.text + } + #[must_use] pub fn children(&self) -> &[Self] { &self.children