fix: change use_state to be clone

This commit is contained in:
Jonathan Kelley committed 2022-02-01 02:05:54 -05:00
1 parent fa020c53e4
commit e02dfc3324
1 file changed
+2 -4
+2 -4
View File
@@ -275,10 +275,8 @@ impl<T: Clone> UseState<T> {
} }
} }
impl<T: 'static> ToOwned for UseState<T> { impl<T: 'static> Clone for UseState<T> {
type Owned = UseState<T>; fn clone(&self) -> Self {
fn to_owned(&self) -> Self::Owned {
UseState { UseState {
current_val: self.current_val.clone(), current_val: self.current_val.clone(),
update_callback: self.update_callback.clone(), update_callback: self.update_callback.clone(),