further cleanup

This commit is contained in:
kevin zhao
2025-11-13 22:07:44 -05:00
parent ceea9075ea
commit 615a027a18
+2 -6
View File
@@ -113,7 +113,8 @@ impl PrefixRule {
if self.matches(example).is_some() {
return Err(Error::ExampleDidMatch {
rule: format!("{self:?}"),
example: join_command(example),
example: try_join(example.iter().map(String::as_str))
.unwrap_or_else(|_| "unable to render example".to_string()),
});
}
}
@@ -152,8 +153,3 @@ impl Rule {
}
}
}
fn join_command(command: &[String]) -> String {
try_join(command.iter().map(String::as_str))
.unwrap_or_else(|_| "unable to render example".to_string())
}