aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorTeddy Wing2016-04-21 16:49:18 -0400
committerTeddy Wing2016-04-21 16:49:18 -0400
commit3a5b7dd83642f5ab93aa70b612dcdbbc10e70935 (patch)
tree3acccfa2ad6b5b0f088e98baa9c5dce77285e922 /src/main.rs
parent222ade989e6d723435e60ff8e5d60a64b3003af3 (diff)
downloadmutt-alias-auto-add-3a5b7dd83642f5ab93aa70b612dcdbbc10e70935.tar.bz2
find_alias_in_file: Return list of aliases not alias lines
My next step is to get the list produced by this function and use it to build a new alias of `#{alias}-#{id + 1}`. In trying to figure out how best to do that, I realised that it would be easier to do if I had actual aliases to work with instead of full Mutt alias lines that I'd have to parse (again). Update our function to give us a list of aliases instead of full alias lines.
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 06f6eb9..fdeab31 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -102,7 +102,7 @@ fn find_alias_in_file(alias: &Alias, file: &str) -> Result<Vec<String>, AliasSea
}
if split[1].starts_with(&alias.alias) {
- matches.push(line.to_owned());
+ matches.push(split[1].to_owned());
}
}