aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTeddy Wing2016-04-19 21:49:50 -0400
committerTeddy Wing2016-04-19 21:49:50 -0400
commit34233725b026212f8e8dd880e00b17cf22324d84 (patch)
treea91e43228d07c1dee5017c51b634c6c7cee76e3b /src
parenta2ff502bffe10f9ba15edeab2ab81f5b4e007cc0 (diff)
downloadmutt-alias-auto-add-34233725b026212f8e8dd880e00b17cf22324d84.tar.bz2
Rename is_alias_in_file to find_alias_in_file
I think we should return a list of matched aliases from this function instead of a simple boolean value. As such, we'll start by renaming the function to something that makes sense in that context. We now need to modify the function and return type in order to provide that information.
Diffstat (limited to 'src')
-rw-r--r--src/main.rs2
-rw-r--r--src/tests.rs6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index 79e3411..a4a36e5 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -81,7 +81,7 @@ fn build_alias(s: &str) -> String {
alias_line
}
-fn is_alias_in_file(alias: &Alias, file: &str) -> Result<(), io::Error> {
+fn find_alias_in_file(alias: &Alias, file: &str) -> Result<(), io::Error> {
let f = try!(File::open(file));
let file = BufReader::new(&f);
for line in file.lines() {
diff --git a/src/tests.rs b/src/tests.rs
index 29723cd..ccacd29 100644
--- a/src/tests.rs
+++ b/src/tests.rs
@@ -1,4 +1,4 @@
-use super::{Alias, is_alias_in_file};
+use super::{Alias, find_alias_in_file};
#[test]
fn new_alias_with_only_email() {
@@ -42,8 +42,8 @@ fn new_alias_with_special_characters() {
#[test]
-fn is_alias_in_file_finds_a_match() {
- is_alias_in_file(
+fn find_alias_in_file_finds_a_match() {
+ find_alias_in_file(
&Alias {
alias: "farnsworth-hubert".to_owned(),
name: "Hubert Farnsworth".to_owned(),