@@ -244,7 +244,7 @@ mod _functools {
244
244
let mut final_kwargs = IndexMap :: new ( ) ;
245
245
246
246
// Add keywords from self.keywords
247
- for ( key, value) in inner. keywords . clone ( ) {
247
+ for ( key, value) in & * inner. keywords {
248
248
let key_str = key
249
249
. downcast :: < crate :: builtins:: PyStr > ( )
250
250
. map_err ( |_| vm. new_type_error ( "keywords must be strings" . to_owned ( ) ) ) ?;
@@ -291,27 +291,24 @@ mod _functools {
291
291
let class_name = zelf. class ( ) . name ( ) ;
292
292
let module = zelf. class ( ) . module ( vm) ;
293
293
294
- // Check if this is a subclass by comparing with the base partial type
295
- let is_subclass = !zelf. class ( ) . is ( PyPartial :: class ( & vm. ctx ) ) ;
296
-
297
- let qualified_name = if !is_subclass {
294
+ let qualified_name = if zelf. class ( ) . is ( PyPartial :: class ( & vm. ctx ) ) {
298
295
// For the base partial class, always use functools.partial
299
- "functools.partial" . to_string ( )
296
+ "functools.partial" . to_owned ( )
300
297
} else {
301
298
// For subclasses, check if they're defined in __main__ or test modules
302
299
match module. downcast :: < crate :: builtins:: PyStr > ( ) {
303
300
Ok ( module_str) => {
304
301
let module_name = module_str. as_str ( ) ;
305
302
match module_name {
306
- "builtins" | "" | "__main__" => class_name. to_string ( ) ,
303
+ "builtins" | "" | "__main__" => class_name. to_owned ( ) ,
307
304
name if name. starts_with ( "test." ) || name == "test" => {
308
305
// For test modules, just use the class name without module prefix
309
- class_name. to_string ( )
306
+ class_name. to_owned ( )
310
307
}
311
308
_ => format ! ( "{}.{}" , module_name, class_name) ,
312
309
}
313
310
}
314
- Err ( _) => class_name. to_string ( ) ,
311
+ Err ( _) => class_name. to_owned ( ) ,
315
312
}
316
313
} ;
317
314
0 commit comments