@@ -74,7 +74,7 @@ pub mod ffi {
7474 #[ diplomat:: rust_link( icu:: calendar:: Date :: to_calendar, FnInStruct ) ]
7575 #[ diplomat:: attr( demo_gen, disable) ] // covered by Date
7676 pub fn to_calendar ( & self , calendar : & Calendar ) -> Box < Date > {
77- Box :: new ( Date ( self . 0 . to_calendar ( calendar. 0 . clone ( ) ) ) )
77+ Box :: new ( Date ( self . 0 . to_calendar ( calendar. 0 ) ) )
7878 }
7979
8080 #[ diplomat:: rust_link( icu:: calendar:: Date :: to_any, FnInStruct ) ]
@@ -247,9 +247,9 @@ pub mod ffi {
247247 iso_day : u8 ,
248248 calendar : & Calendar ,
249249 ) -> Result < Box < Date > , CalendarError > {
250- let cal = calendar. 0 . clone ( ) ;
251250 Ok ( Box :: new ( Date (
252- icu_calendar:: Date :: try_new_iso ( iso_year, iso_month, iso_day) ?. to_calendar ( cal) ,
251+ icu_calendar:: Date :: try_new_iso ( iso_year, iso_month, iso_day) ?
252+ . to_calendar ( calendar. 0 ) ,
253253 ) ) )
254254 }
255255
@@ -265,11 +265,10 @@ pub mod ffi {
265265 options : DateFromFieldsOptions ,
266266 calendar : & Calendar ,
267267 ) -> Result < Box < Date > , CalendarDateFromFieldsError > {
268- let cal = calendar. 0 . clone ( ) ;
269268 Ok ( Box :: new ( Date ( icu_calendar:: Date :: try_from_fields (
270269 fields. into ( ) ,
271270 options. into ( ) ,
272- cal ,
271+ calendar . 0 ,
273272 ) ?) ) )
274273 }
275274
@@ -293,9 +292,8 @@ pub mod ffi {
293292 None
294293 } ;
295294 let month = icu_calendar:: types:: Month :: try_from_utf8 ( month_code) ?. code ( ) ;
296- let cal = calendar. 0 . clone ( ) ;
297295 Ok ( Box :: new ( Date ( icu_calendar:: Date :: try_new_from_codes (
298- era, year, month, day, cal ,
296+ era, year, month, day, calendar . 0 ,
299297 ) ?) ) )
300298 }
301299
@@ -304,10 +302,9 @@ pub mod ffi {
304302 #[ diplomat:: attr( all( supports = named_constructors) , named_constructor) ]
305303 #[ diplomat:: demo( default_constructor) ]
306304 pub fn from_rata_die ( rd : i64 , calendar : & Calendar ) -> Result < Box < Date > , CalendarError > {
307- let cal = calendar. 0 . clone ( ) ;
308305 Ok ( Box :: new ( Date ( icu_calendar:: Date :: from_rata_die (
309306 icu_calendar:: types:: RataDie :: new ( rd) ,
310- cal ,
307+ calendar . 0 ,
311308 ) ) ) )
312309 }
313310
@@ -321,16 +318,15 @@ pub mod ffi {
321318 calendar : & Calendar ,
322319 ) -> Result < Box < Date > , Rfc9557ParseError > {
323320 Ok ( Box :: new ( Date ( icu_calendar:: Date :: try_from_utf8 (
324- v,
325- calendar. 0 . clone ( ) ,
321+ v, calendar. 0 ,
326322 ) ?) ) )
327323 }
328324
329325 /// Convert this date to one in a different calendar
330326 #[ diplomat:: rust_link( icu:: calendar:: Date :: to_calendar, FnInStruct ) ]
331327 #[ diplomat:: rust_link( icu:: calendar:: Date :: convert_any, FnInStruct , hidden) ]
332328 pub fn to_calendar ( & self , calendar : & Calendar ) -> Box < Date > {
333- Box :: new ( Date ( self . 0 . to_calendar ( calendar. 0 . clone ( ) ) ) )
329+ Box :: new ( Date ( self . 0 . to_calendar ( calendar. 0 ) ) )
334330 }
335331
336332 /// Converts this date to ISO
@@ -501,7 +497,7 @@ pub mod ffi {
501497 #[ diplomat:: rust_link( icu:: calendar:: Date :: calendar_wrapper, FnInStruct , hidden) ]
502498 #[ diplomat:: attr( auto, getter) ]
503499 pub fn calendar ( & self ) -> Box < Calendar > {
504- Box :: new ( Calendar ( self . 0 . calendar ( ) . clone ( ) ) )
500+ Box :: new ( Calendar ( * self . 0 . calendar ( ) ) )
505501 }
506502 }
507503
0 commit comments