Skip to content

Commit

Permalink
#72 View now Clone
Browse files Browse the repository at this point in the history
  • Loading branch information
wtholliday committed Jan 22, 2025
1 parent 52e50cc commit 57ea8fd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/custom_modifier2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ impl Default for MyState {
}
}

trait MyMod: View + Clone + Sized {
trait MyMod: View + Sized {
fn my_modifier(self) -> impl View {
state(MyState::default, move |s, cx| {
self.clone().offset(LocalOffset::new(0.0, cx[s].offset))
Expand All @@ -21,9 +21,9 @@ trait MyMod: View + Clone + Sized {
}
}

impl<V: View + Clone> MyMod for V {}
impl<V: View> MyMod for V {}

fn my_text(name: &str) -> impl View + Clone {
fn my_text(name: &str) -> impl View {
let name = name.to_string();
text(name.as_str())
}
Expand Down

0 comments on commit 57ea8fd

Please sign in to comment.