@@ -2143,16 +2143,16 @@ impl Compiler<'_> {
2143
2143
attrs : & [ Identifier ] ,
2144
2144
_patterns : & [ Pattern ] ,
2145
2145
) -> CompileResult < ( ) > {
2146
- let nattrs = attrs. len ( ) ;
2147
- for i in 0 ..nattrs {
2146
+ let n_attrs = attrs. len ( ) ;
2147
+ for i in 0 ..n_attrs {
2148
2148
let attr = attrs[ i] . as_str ( ) ;
2149
2149
// Check if the attribute name is forbidden in a Store context.
2150
2150
if self . forbidden_name ( attr, NameUsage :: Store ) ? {
2151
2151
// Return an error if the name is forbidden.
2152
2152
return Err ( self . compile_error_forbidden_name ( attr) ) ;
2153
2153
}
2154
2154
// Check for duplicates: compare with every subsequent attribute.
2155
- for ident in attrs. iter ( ) . take ( nattrs ) . skip ( i + 1 ) {
2155
+ for ident in attrs. iter ( ) . take ( n_attrs ) . skip ( i + 1 ) {
2156
2156
let other = ident. as_str ( ) ;
2157
2157
if attr == other {
2158
2158
todo ! ( ) ;
@@ -2184,20 +2184,20 @@ impl Compiler<'_> {
2184
2184
}
2185
2185
2186
2186
let nargs = patterns. len ( ) ;
2187
- let nattrs = kwd_attrs. len ( ) ;
2187
+ let n_attrs = kwd_attrs. len ( ) ;
2188
2188
let nkwd_patterns = kwd_patterns. len ( ) ;
2189
2189
2190
2190
// Validate that keyword attribute names and patterns match in length.
2191
- if nattrs != nkwd_patterns {
2191
+ if n_attrs != nkwd_patterns {
2192
2192
let msg = format ! (
2193
2193
"kwd_attrs ({}) / kwd_patterns ({}) length mismatch in class pattern" ,
2194
- nattrs , nkwd_patterns
2194
+ n_attrs , nkwd_patterns
2195
2195
) ;
2196
2196
unreachable ! ( "{}" , msg) ;
2197
2197
}
2198
2198
2199
2199
// Check for too many sub-patterns.
2200
- if nargs > u32:: MAX as usize || ( nargs + nattrs ) . saturating_sub ( 1 ) > i32:: MAX as usize {
2200
+ if nargs > u32:: MAX as usize || ( nargs + n_attrs ) . saturating_sub ( 1 ) > i32:: MAX as usize {
2201
2201
let msg = format ! (
2202
2202
"too many sub-patterns in class pattern {:?}" ,
2203
2203
match_class. cls
@@ -2207,7 +2207,7 @@ impl Compiler<'_> {
2207
2207
}
2208
2208
2209
2209
// Validate keyword attributes if any.
2210
- if nattrs != 0 {
2210
+ if n_attrs != 0 {
2211
2211
self . validate_kwd_attrs ( & kwd_attrs, & kwd_patterns) ?;
2212
2212
}
2213
2213
@@ -2237,12 +2237,12 @@ impl Compiler<'_> {
2237
2237
// 5. Compare with IS_OP 1.
2238
2238
emit ! ( self , Instruction :: IsOperation ( true ) ) ;
2239
2239
2240
- // At this point the TOS is a tuple of (nargs + nattrs ) attributes (or None).
2240
+ // At this point the TOS is a tuple of (nargs + n_attrs ) attributes (or None).
2241
2241
pc. on_top += 1 ;
2242
2242
self . jump_to_fail_pop ( pc, JumpOp :: PopJumpIfFalse ) ?;
2243
2243
2244
- // Unpack the tuple into (nargs + nattrs ) items.
2245
- let total = nargs + nattrs ;
2244
+ // Unpack the tuple into (nargs + n_attrs ) items.
2245
+ let total = nargs + n_attrs ;
2246
2246
emit ! (
2247
2247
self ,
2248
2248
Instruction :: UnpackSequence {
@@ -2280,12 +2280,12 @@ impl Compiler<'_> {
2280
2280
// let keys = &mapping.keys;
2281
2281
// let patterns = &mapping.patterns;
2282
2282
// let size = keys.len();
2283
- // let npatterns = patterns.len();
2283
+ // let n_patterns = patterns.len();
2284
2284
2285
- // if size != npatterns {
2286
- // panic!("keys ({}) / patterns ({}) length mismatch in mapping pattern", size, npatterns );
2285
+ // if size != n_patterns {
2286
+ // panic!("keys ({}) / patterns ({}) length mismatch in mapping pattern", size, n_patterns );
2287
2287
// // return self.compiler_error(
2288
- // // &format!("keys ({}) / patterns ({}) length mismatch in mapping pattern", size, npatterns )
2288
+ // // &format!("keys ({}) / patterns ({}) length mismatch in mapping pattern", size, n_patterns )
2289
2289
// // );
2290
2290
// }
2291
2291
0 commit comments