@@ -176,19 +176,22 @@ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables)
176
176
} else { return Err(~" stack is empty") } ,
177
177
'=' => if stack. len ( ) > 1 {
178
178
match ( stack. pop ( ) , stack. pop ( ) ) {
179
- ( Number ( y) , Number ( x) ) => stack. push ( Number ( if x == y { 1 } else { 0 } ) ) ,
179
+ ( Number ( y) , Number ( x) ) => stack. push ( Number ( if x == y { 1 }
180
+ else { 0 } ) ) ,
180
181
_ => return Err ( ~"non-numbers on stack with =")
181
182
}
182
183
} else { return Err(~" stack is empty") } ,
183
184
'>' => if stack. len ( ) > 1 {
184
185
match ( stack. pop ( ) , stack. pop ( ) ) {
185
- ( Number ( y) , Number ( x) ) => stack. push ( Number ( if x > y { 1 } else { 0 } ) ) ,
186
+ ( Number ( y) , Number ( x) ) => stack. push ( Number ( if x > y { 1 }
187
+ else { 0 } ) ) ,
186
188
_ => return Err ( ~"non-numbers on stack with >")
187
189
}
188
190
} else { return Err(~" stack is empty") } ,
189
191
'<' => if stack. len ( ) > 1 {
190
192
match ( stack. pop ( ) , stack. pop ( ) ) {
191
- ( Number ( y) , Number ( x) ) => stack. push ( Number ( if x < y { 1 } else { 0 } ) ) ,
193
+ ( Number ( y) , Number ( x) ) => stack. push ( Number ( if x < y { 1 }
194
+ else { 0 } ) ) ,
192
195
_ => return Err ( ~"non-numbers on stack with <")
193
196
}
194
197
} else { return Err(~" stack is empty") } ,
@@ -353,12 +356,14 @@ mod test {
353
356
#[ test]
354
357
fn test_basic_setabf ( ) {
355
358
let s = bytes ! ( "\\ E[48;5;%p1%dm" ) ;
356
- assert_eq ! ( expand( s, [ Number ( 1 ) ] , & mut Variables :: new( ) ) . unwrap( ) , bytes!( "\\ E[48;5;1m" ) . to_owned( ) ) ;
359
+ assert_eq ! ( expand( s, [ Number ( 1 ) ] , & mut Variables :: new( ) ) . unwrap( ) ,
360
+ bytes!( "\\ E[48;5;1m" ) . to_owned( ) ) ;
357
361
}
358
362
359
363
#[ test]
360
364
fn test_multiple_int_constants ( ) {
361
- assert_eq ! ( expand( bytes!( "%{1}%{2}%d%d" ) , [ ] , & mut Variables :: new( ) ) . unwrap( ) , bytes!( "21" ) . to_owned( ) ) ;
365
+ assert_eq ! ( expand( bytes!( "%{1}%{2}%d%d" ) , [ ] , & mut Variables :: new( ) ) . unwrap( ) ,
366
+ bytes!( "21" ) . to_owned( ) ) ;
362
367
}
363
368
364
369
#[ test]
0 commit comments