mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-09 19:00:46 +00:00
Fix clippy warnings
Add default implementations Return &mut View instead of &mut Box<View>
This commit is contained in:
parent
2ffae1f524
commit
22b8364877
@ -31,9 +31,9 @@ impl ListChild {
|
||||
}
|
||||
}
|
||||
|
||||
fn view(&mut self) -> Option<&mut Box<View>> {
|
||||
fn view(&mut self) -> Option<&mut View> {
|
||||
match *self {
|
||||
ListChild::Row(_, ref mut view) => Some(view),
|
||||
ListChild::Row(_, ref mut view) => Some(view.as_mut()),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,12 @@ pub struct RadioGroup<T> {
|
||||
state: Rc<RefCell<SharedState<T>>>,
|
||||
}
|
||||
|
||||
impl <T> Default for RadioGroup<T> {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> RadioGroup<T> {
|
||||
/// Creates an empty group for radio buttons.
|
||||
pub fn new() -> Self {
|
||||
|
@ -67,6 +67,12 @@ pub struct SelectView<T = String> {
|
||||
last_size: Vec2,
|
||||
}
|
||||
|
||||
impl <T: 'static> Default for SelectView<T> {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: 'static> SelectView<T> {
|
||||
/// Creates a new empty SelectView.
|
||||
pub fn new() -> Self {
|
||||
|
Loading…
Reference in New Issue
Block a user