@@ -51,9 +51,11 @@ impl X11DeviceXI2Builder {
51
51
}
52
52
}
53
53
54
- pub fn display ( self , display : & impl IsA < gdk:: Display > ) -> Self {
54
+ pub fn display < ' a , P : IsA < gdk:: Display > > ( self , display : impl Into < Option < & ' a P > > ) -> Self {
55
55
Self {
56
- builder : self . builder . property ( "display" , display. clone ( ) . upcast ( ) ) ,
56
+ builder : self
57
+ . builder
58
+ . property ( "display" , display. into ( ) . as_ref ( ) . map ( |p| p. as_ref ( ) ) ) ,
57
59
}
58
60
}
59
61
@@ -63,7 +65,7 @@ impl X11DeviceXI2Builder {
63
65
}
64
66
}
65
67
66
- pub fn name ( self , name : impl Into < glib :: GString > ) -> Self {
68
+ pub fn name < ' a > ( self , name : impl Into < Option < & ' a str > > ) -> Self {
67
69
Self {
68
70
builder : self . builder . property ( "name" , name. into ( ) ) ,
69
71
}
@@ -75,15 +77,15 @@ impl X11DeviceXI2Builder {
75
77
}
76
78
}
77
79
78
- pub fn product_id ( self , product_id : impl Into < glib :: GString > ) -> Self {
80
+ pub fn product_id < ' a > ( self , product_id : impl Into < Option < & ' a str > > ) -> Self {
79
81
Self {
80
82
builder : self . builder . property ( "product-id" , product_id. into ( ) ) ,
81
83
}
82
84
}
83
85
84
- pub fn seat ( self , seat : & gdk:: Seat ) -> Self {
86
+ pub fn seat < ' a > ( self , seat : impl Into < Option < & ' a gdk:: Seat > > ) -> Self {
85
87
Self {
86
- builder : self . builder . property ( "seat" , seat. clone ( ) ) ,
88
+ builder : self . builder . property ( "seat" , seat. into ( ) ) ,
87
89
}
88
90
}
89
91
@@ -93,7 +95,7 @@ impl X11DeviceXI2Builder {
93
95
}
94
96
}
95
97
96
- pub fn vendor_id ( self , vendor_id : impl Into < glib :: GString > ) -> Self {
98
+ pub fn vendor_id < ' a > ( self , vendor_id : impl Into < Option < & ' a str > > ) -> Self {
97
99
Self {
98
100
builder : self . builder . property ( "vendor-id" , vendor_id. into ( ) ) ,
99
101
}
0 commit comments