mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-12 22:40:09 +01:00
Reviewed-on: https://codeberg.org/iff/pay-respects/pulls/8 Co-authored-by: Integral <integral@member.fsf.org> Co-committed-by: Integral <integral@member.fsf.org>
This commit is contained in:
parent
7c7cc4d285
commit
9728ce48a6
2 changed files with 6 additions and 6 deletions
|
|
@ -27,7 +27,7 @@ pub fn parse_rules(input: TokenStream) -> TokenStream {
|
|||
let directory = input.to_string().trim_matches('"').to_owned();
|
||||
let rules = get_rules(directory);
|
||||
|
||||
gen_match_rules(rules)
|
||||
gen_match_rules(&rules)
|
||||
}
|
||||
|
||||
#[derive(serde::Deserialize)]
|
||||
|
|
@ -211,7 +211,7 @@ fn eval_suggest(suggest: &str) -> TokenStream2 {
|
|||
replaces::command(&mut suggest, &mut replace_list);
|
||||
replaces::shell(&mut suggest, &mut cmd_list);
|
||||
replaces::typo(&mut suggest, &mut replace_list);
|
||||
replaces::shell_tag(&mut suggest, &mut replace_list, cmd_list);
|
||||
replaces::shell_tag(&mut suggest, &mut replace_list, &cmd_list);
|
||||
|
||||
quote! {
|
||||
#(#opt_list)*
|
||||
|
|
|
|||
|
|
@ -208,14 +208,14 @@ pub fn typo(suggest: &mut String, replace_list: &mut Vec<TokenStream2>) {
|
|||
"\")"
|
||||
);
|
||||
format!(
|
||||
"suggest_typo(&split[{}], {}, executables)",
|
||||
"suggest_typo(&split[{}], &{}, executables)",
|
||||
string_index, function
|
||||
)
|
||||
} else {
|
||||
let string_match_list = match_list.join("\".to_string(), \"");
|
||||
let string_match_list = format!("\"{}\".to_string()", string_match_list);
|
||||
format!(
|
||||
"suggest_typo(&split[{}], vec![{}], executables)",
|
||||
"suggest_typo(&split[{}], &[{}], executables)",
|
||||
string_index, string_match_list
|
||||
)
|
||||
};
|
||||
|
|
@ -243,8 +243,8 @@ pub fn shell_tag(suggest: &mut String, replace_list: &mut Vec<TokenStream2>, cmd
|
|||
let tag_name = "shell";
|
||||
|
||||
for command in cmd_list {
|
||||
if suggest.contains(&command) {
|
||||
*suggest = suggest.replace(&command, &tag(tag_name, replace_tag));
|
||||
if suggest.contains(command) {
|
||||
*suggest = suggest.replace(command, &tag(tag_name, replace_tag));
|
||||
|
||||
let split = command.split_once(',').unwrap();
|
||||
let argument = split.1.trim_end_matches(')').trim();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue