@@ -360,7 +360,7 @@ impl Compiler {
360360 fblock : Vec :: with_capacity ( MAXBLOCKS ) ,
361361 symbol_table_index : 0 , // Module is always the first symbol table
362362 } ;
363- Compiler {
363+ Self {
364364 code_stack : vec ! [ module_code] ,
365365 symbol_table_stack : Vec :: new ( ) ,
366366 source_file,
@@ -380,7 +380,7 @@ impl Compiler {
380380
381381 /// Check if the slice is a two-element slice (no step)
382382 // = is_two_element_slice
383- fn is_two_element_slice ( slice : & Expr ) -> bool {
383+ const fn is_two_element_slice ( slice : & Expr ) -> bool {
384384 matches ! ( slice, Expr :: Slice ( s) if s. step. is_none( ) )
385385 }
386386
@@ -882,7 +882,7 @@ impl Compiler {
882882 self . _name_inner ( name, |i| & mut i. metadata . names )
883883 }
884884 fn varname ( & mut self , name : & str ) -> CompileResult < bytecode:: NameIdx > {
885- if Compiler :: is_forbidden_arg_name ( name) {
885+ if Self :: is_forbidden_arg_name ( name) {
886886 return Err ( self . error ( CodegenErrorType :: SyntaxError ( format ! (
887887 "cannot assign to {name}" ,
888888 ) ) ) ) ;
@@ -3435,7 +3435,7 @@ impl Compiler {
34353435
34363436 // Create a new tuple of attribute names.
34373437 let mut attr_names = vec ! [ ] ;
3438- for name in kwd_attrs. iter ( ) {
3438+ for name in & kwd_attrs {
34393439 // Py_NewRef(name) is emulated by cloning the name into a PyObject.
34403440 attr_names. push ( ConstantData :: Str {
34413441 value : name. as_str ( ) . to_string ( ) . into ( ) ,
@@ -3667,7 +3667,7 @@ impl Compiler {
36673667 pc. stores . insert ( insert_pos + j, elem) ;
36683668 }
36693669 // Also perform the same rotation on the evaluation stack.
3670- for _ in 0 ..( i_stores + 1 ) {
3670+ for _ in 0 ..= i_stores {
36713671 self . pattern_helper_rotate ( i_control + 1 ) ?;
36723672 }
36733673 }
@@ -4547,7 +4547,7 @@ impl Compiler {
45474547 } ) => {
45484548 let prev_ctx = self . ctx ;
45494549 let name = "<lambda>" . to_owned ( ) ;
4550- let default_params = Default :: default ( ) ;
4550+ let default_params = Parameters :: default ( ) ;
45514551 let params = parameters. as_deref ( ) . unwrap_or ( & default_params) ;
45524552
45534553 // Prepare defaults before entering function
@@ -4577,7 +4577,7 @@ impl Compiler {
45774577 let have_kwdefaults = !kw_with_defaults. is_empty ( ) ;
45784578 if have_kwdefaults {
45794579 let default_kw_count = kw_with_defaults. len ( ) ;
4580- for ( arg, default) in kw_with_defaults. iter ( ) {
4580+ for ( arg, default) in & kw_with_defaults {
45814581 self . emit_load_const ( ConstantData :: Str {
45824582 value : arg. name . as_str ( ) . into ( ) ,
45834583 } ) ;
0 commit comments