@@ -187,7 +187,7 @@ fn get_commands(template: &str) -> Result<Vec<Command>, ()> {
187
187
/// Performs the actual work of ensuring a command passes. Generally assumes the command
188
188
/// is syntactically valid.
189
189
fn check_command ( command : Command , cache : & mut Cache ) -> Result < ( ) , CkError > {
190
- // FIXME: Be more granular about why, (eg syntax error, count not equal)
190
+ // FIXME: Be more granular about why, (e.g. syntax error, count not equal)
191
191
let result = match command. kind {
192
192
CommandKind :: Has => {
193
193
match command. args . len ( ) {
@@ -215,7 +215,7 @@ fn check_command(command: Command, cache: &mut Cache) -> Result<(), CkError> {
215
215
v_holder = serde_json:: from_str ( & command. args [ 2 ] ) . unwrap ( ) ;
216
216
& v_holder
217
217
} ;
218
- ! results. is_empty ( ) && results . into_iter ( ) . any ( |val| val == pat)
218
+ results. contains ( pat)
219
219
}
220
220
Err ( _) => false ,
221
221
}
@@ -263,7 +263,7 @@ fn check_command(command: Command, cache: &mut Cache) -> Result<(), CkError> {
263
263
Ok ( results) => {
264
264
assert_eq ! ( results. len( ) , 1 ) ;
265
265
let r = cache. variables . insert ( command. args [ 0 ] . clone ( ) , results[ 0 ] . clone ( ) ) ;
266
- assert ! ( r. is_none( ) , "Name collision" ) ;
266
+ assert ! ( r. is_none( ) , "Name collision: {} is duplicated" , command . args [ 0 ] ) ;
267
267
true
268
268
}
269
269
Err ( _) => false ,
0 commit comments