summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-06-25 06:20:06 +0000
committerBlaž Hrastnik2021-06-27 14:28:22 +0000
commit90d675fb158e4a14ae2bbd835c466d91343c193d (patch)
tree4928fa864eee70b301fec860bca9537e600932a2
parentcac6e1b282c981a199ea05ba9fdfc513e54c9175 (diff)
Fix AnyComponent test
-rw-r--r--helix-term/src/compositor.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/helix-term/src/compositor.rs b/helix-term/src/compositor.rs
index cd0a12b5..c00b95e9 100644
--- a/helix-term/src/compositor.rs
+++ b/helix-term/src/compositor.rs
@@ -180,13 +180,14 @@ pub trait AnyComponent {
/// Returns a boxed any from a boxed self.
///
/// Can be used before `Box::downcast()`.
- //
- // # Examples
- //
- // ```rust
- // let boxed: Box<Component> = Box::new(TextComponent::new("text"));
- // let text: Box<TextComponent> = boxed.as_boxed_any().downcast().unwrap();
- // ```
+ ///
+ /// # Examples
+ ///
+ /// ```rust
+ /// use helix_term::{ui::Text, compositor::Component};
+ /// let boxed: Box<Component> = Box::new(Text::new("text".to_string()));
+ /// let text: Box<Text> = boxed.as_boxed_any().downcast().unwrap();
+ /// ```
fn as_boxed_any(self: Box<Self>) -> Box<dyn Any>;
}