Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit a22d948

Browse files
aDotInTheVoidJoshua Nelson
and
Joshua Nelson
authored
Apply suggestions from code review
Co-authored-by: Joshua Nelson <[email protected]>
1 parent dd4b938 commit a22d948

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/tools/jsondocck/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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.
189189
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)
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

Comments
 (0)