File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ fn props() {
23
23
}
24
24
25
25
pub mod imp {
26
+ use std:: rc:: Rc ;
27
+
26
28
use super :: * ;
27
29
28
30
#[ derive( Props , Default ) ]
@@ -53,6 +55,8 @@ fn props() {
53
55
boxed : RefCell < SimpleBoxedString > ,
54
56
#[ prop( get, set) ]
55
57
optional : RefCell < Option < String > > ,
58
+ #[ prop( get, set) ]
59
+ smart_pointer : Rc < RefCell < String > > ,
56
60
}
57
61
58
62
#[ glib:: object_subclass]
Original file line number Diff line number Diff line change @@ -48,16 +48,17 @@ impl<T: Property> Property for RwLock<T> {
48
48
type Value = T ;
49
49
type ParamSpec = T :: ParamSpec ;
50
50
}
51
- impl < T : Property > Property for Rc < T > {
51
+ impl < T : Property > Property for OnceCell < T > {
52
52
type Value = T ;
53
53
type ParamSpec = T :: ParamSpec ;
54
54
}
55
- impl < T : Property > Property for Arc < T > {
56
- type Value = T ;
55
+ // Handle smart pointers trasparently
56
+ impl < T : Property > Property for Rc < T > {
57
+ type Value = T :: Value ;
57
58
type ParamSpec = T :: ParamSpec ;
58
59
}
59
- impl < T : Property > Property for OnceCell < T > {
60
- type Value = T ;
60
+ impl < T : Property > Property for Arc < T > {
61
+ type Value = T :: Value ;
61
62
type ParamSpec = T :: ParamSpec ;
62
63
}
63
64
You can’t perform that action at this time.
0 commit comments