This repository was archived by the owner on Jun 8, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 5
5
use ffi;
6
6
use gobject_ffi;
7
7
8
+ use std:: borrow:: Borrow ;
8
9
use std:: marker;
9
10
use std:: mem;
10
11
use std:: ptr;
@@ -119,12 +120,13 @@ pub trait ObjectInterfaceExt: ObjectInterface {
119
120
/// Install properties on the interface.
120
121
///
121
122
/// All implementors of the interface must provide these properties.
122
- fn install_properties ( & mut self , properties : & [ Property ] ) {
123
+ fn install_properties < ' a , T : Borrow < Property < ' a > > > ( & mut self , properties : & [ T ] ) {
123
124
if properties. is_empty ( ) {
124
125
return ;
125
126
}
126
127
127
128
for property in properties {
129
+ let property = property. borrow ( ) ;
128
130
let pspec = ( property. 1 ) ( property. 0 ) ;
129
131
unsafe {
130
132
gobject_ffi:: g_object_interface_install_property (
Original file line number Diff line number Diff line change 8
8
use ffi;
9
9
use gobject_ffi;
10
10
11
+ use std:: borrow:: Borrow ;
11
12
use std:: mem;
12
13
use std:: ptr;
13
14
@@ -143,14 +144,15 @@ pub unsafe trait ObjectClassSubclassExt: Sized + 'static {
143
144
///
144
145
/// The index in the properties array is going to be the index passed to the
145
146
/// property setters and getters.
146
- fn install_properties ( & mut self , properties : & [ Property ] ) {
147
+ fn install_properties < ' a , T : Borrow < Property < ' a > > > ( & mut self , properties : & [ T ] ) {
147
148
if properties. is_empty ( ) {
148
149
return ;
149
150
}
150
151
151
152
let mut pspecs = Vec :: with_capacity ( properties. len ( ) ) ;
152
153
153
154
for property in properties {
155
+ let property = property. borrow ( ) ;
154
156
let pspec = ( property. 1 ) ( property. 0 ) ;
155
157
pspecs. push ( pspec) ;
156
158
}
You can’t perform that action at this time.
0 commit comments