mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-12 06:20:09 +01:00
feat: conditional suggestions
This commit is contained in:
parent
72db07051b
commit
6b4d926dde
5 changed files with 54 additions and 19 deletions
|
|
@ -20,7 +20,7 @@ struct Rule {
|
|||
#[derive(serde::Deserialize)]
|
||||
struct MatchOutput {
|
||||
pattern: Vec<String>,
|
||||
suggest: String,
|
||||
suggest: Vec<String>,
|
||||
}
|
||||
|
||||
fn get_rules(directory: String) -> Vec<Rule> {
|
||||
|
|
@ -51,9 +51,9 @@ fn gen_string_hashmap(rules: Vec<Rule>) -> String {
|
|||
.collect::<Vec<String>>();
|
||||
let suggest = match_output.suggest;
|
||||
string_hashmap.push_str(&format!(
|
||||
"(vec![\"{}\"], \"{}\"),",
|
||||
"(vec![\"{}\"], vec![\"{}\"]),",
|
||||
pattern.join("\", \""),
|
||||
suggest
|
||||
suggest.join("\", \"")
|
||||
));
|
||||
}
|
||||
string_hashmap.push_str("]),");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue