@@ -10,7 +10,7 @@ use std::ffi::CStr;
10
10
use crate :: builtin:: { GString , NodePath , StringName , Variant } ;
11
11
use crate :: meta:: sealed:: Sealed ;
12
12
use crate :: meta:: traits:: { GodotFfiVariant , GodotNullableFfi } ;
13
- use crate :: meta:: { CowArg , GodotType , ObjectArg , ToGodot } ;
13
+ use crate :: meta:: { CowArg , FfiArg , GodotType , ObjectArg , ToGodot } ;
14
14
use crate :: obj:: { bounds, Bounds , DynGd , Gd , GodotClass , Inherits } ;
15
15
16
16
/// Implicit conversions for arguments passed to Godot APIs.
@@ -97,13 +97,14 @@ where
97
97
98
98
/// FFI-optimized argument conversion that may use `FfiObject` when beneficial.
99
99
///
100
- /// Defaults to calling `into_arg()`, which always works, but might be an `Owned` for a conservative approach (e.g. object upcast).
100
+ /// Defaults to calling `into_arg()` and wrapping in `FfiArg::Cow()`, which always works, but might be an `Owned` for a conservative
101
+ /// approach (e.g. object upcast).
101
102
#[ doc( hidden) ]
102
- fn into_ffi_arg < ' arg > ( self ) -> CowArg < ' arg , T >
103
+ fn into_ffi_arg < ' arg > ( self ) -> FfiArg < ' arg , T >
103
104
where
104
105
Self : ' arg ,
105
106
{
106
- self . into_arg ( )
107
+ FfiArg :: Cow ( self . into_arg ( ) )
107
108
}
108
109
}
109
110
@@ -157,12 +158,12 @@ where
157
158
}
158
159
}
159
160
160
- fn into_ffi_arg < ' arg > ( self ) -> CowArg < ' arg , Gd < Base > >
161
+ fn into_ffi_arg < ' arg > ( self ) -> FfiArg < ' arg , Gd < Base > >
161
162
where
162
163
Self : ' arg ,
163
164
{
164
165
let arg = ObjectArg :: from_gd ( self ) ;
165
- CowArg :: FfiObject ( arg)
166
+ FfiArg :: FfiObject ( arg)
166
167
}
167
168
}
168
169
@@ -189,12 +190,12 @@ where
189
190
}
190
191
}
191
192
192
- fn into_ffi_arg < ' arg > ( self ) -> CowArg < ' arg , DynGd < Base , D > >
193
+ fn into_ffi_arg < ' arg > ( self ) -> FfiArg < ' arg , DynGd < Base , D > >
193
194
where
194
195
Self : ' arg ,
195
196
{
196
197
let arg = ObjectArg :: from_gd ( self ) ;
197
- CowArg :: FfiObject ( arg)
198
+ FfiArg :: FfiObject ( arg)
198
199
}
199
200
}
200
201
@@ -213,7 +214,7 @@ where
213
214
AsArg :: into_arg ( gd_ref)
214
215
}
215
216
216
- fn into_ffi_arg < ' arg > ( self ) -> CowArg < ' arg , Gd < Base > >
217
+ fn into_ffi_arg < ' arg > ( self ) -> FfiArg < ' arg , Gd < Base > >
217
218
where
218
219
Self : ' arg ,
219
220
{
@@ -242,12 +243,12 @@ where
242
243
}
243
244
}
244
245
245
- fn into_ffi_arg < ' arg > ( self ) -> CowArg < ' arg , Option < Gd < Base > > >
246
+ fn into_ffi_arg < ' arg > ( self ) -> FfiArg < ' arg , Option < Gd < Base > > >
246
247
where
247
248
Self : ' arg ,
248
249
{
249
250
let arg = ObjectArg :: from_option_gd ( self ) ;
250
- CowArg :: FfiObject ( arg)
251
+ FfiArg :: FfiObject ( arg)
251
252
}
252
253
}
253
254
@@ -265,12 +266,12 @@ where
265
266
CowArg :: Owned ( Some ( self . clone ( ) . upcast :: < Base > ( ) ) )
266
267
}
267
268
268
- fn into_ffi_arg < ' arg > ( self ) -> CowArg < ' arg , Option < Gd < Base > > >
269
+ fn into_ffi_arg < ' arg > ( self ) -> FfiArg < ' arg , Option < Gd < Base > > >
269
270
where
270
271
Self : ' arg ,
271
272
{
272
273
let arg = ObjectArg :: from_gd ( self ) ;
273
- CowArg :: FfiObject ( arg)
274
+ FfiArg :: FfiObject ( arg)
274
275
}
275
276
}
276
277
@@ -289,7 +290,7 @@ where
289
290
AsArg :: into_arg ( gd_ref)
290
291
}
291
292
292
- fn into_ffi_arg < ' arg > ( self ) -> CowArg < ' arg , Option < Gd < Base > > >
293
+ fn into_ffi_arg < ' arg > ( self ) -> FfiArg < ' arg , Option < Gd < Base > > >
293
294
where
294
295
Self : ' arg ,
295
296
{
0 commit comments