mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 09:26:19 +04:00
Fix AnyComponent test
This commit is contained in:
parent
cac6e1b282
commit
90d675fb15
@ -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>;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user