소스 검색

fix: change use_state to be clone

Jonathan Kelley 3 년 전
부모
커밋
e02dfc3324
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 4
      packages/hooks/src/usestate.rs

+ 2 - 4
packages/hooks/src/usestate.rs

@@ -275,10 +275,8 @@ impl<T: Clone> UseState<T> {
     }
 }
 
-impl<T: 'static> ToOwned for UseState<T> {
-    type Owned = UseState<T>;
-
-    fn to_owned(&self) -> Self::Owned {
+impl<T: 'static> Clone for UseState<T> {
+    fn clone(&self) -> Self {
         UseState {
             current_val: self.current_val.clone(),
             update_callback: self.update_callback.clone(),