@@ -187,7 +187,7 @@ fn get_commands(template: &str) -> Result<Vec<Command>, ()> {
187187/// Performs the actual work of ensuring a command passes. Generally assumes the command
188188/// is syntactically valid.
189189fn 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)
191191 let result = match command. kind {
192192 CommandKind :: Has => {
193193 match command. args . len ( ) {
@@ -215,7 +215,7 @@ fn check_command(command: Command, cache: &mut Cache) -> Result<(), CkError> {
215215 v_holder = serde_json:: from_str ( & command. args [ 2 ] ) . unwrap ( ) ;
216216 & v_holder
217217 } ;
218- ! results. is_empty ( ) && results . into_iter ( ) . any ( |val| val == pat)
218+ results. contains ( pat)
219219 }
220220 Err ( _) => false ,
221221 }
@@ -263,7 +263,7 @@ fn check_command(command: Command, cache: &mut Cache) -> Result<(), CkError> {
263263 Ok ( results) => {
264264 assert_eq ! ( results. len( ) , 1 ) ;
265265 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 ] ) ;
267267 true
268268 }
269269 Err ( _) => false ,
0 commit comments