Get rid of mostly unused Justfile.recipes() (#98)

This commit is contained in:
Casey Rodarmor 2016-11-12 14:43:47 -08:00 committed by GitHub
parent 1856646a9c
commit 5b2d671c1d
2 changed files with 1 additions and 5 deletions

View File

@ -199,7 +199,7 @@ pub fn app() {
if justfile.count() == 0 { if justfile.count() == 0 {
warn!("Justfile contains no recipes."); warn!("Justfile contains no recipes.");
} else { } else {
println!("{}", justfile.recipes().join(" ")); println!("{}", justfile.recipes.keys().cloned().collect::<Vec<_>>().join(" "));
} }
process::exit(0); process::exit(0);
} }

View File

@ -1062,10 +1062,6 @@ impl<'a, 'b> Justfile<'a> where 'a: 'b {
self.recipes.len() self.recipes.len()
} }
fn recipes(&self) -> Vec<&'a str> {
self.recipes.keys().cloned().collect()
}
fn suggest(&self, name: &str) -> Option<&'a str> { fn suggest(&self, name: &str) -> Option<&'a str> {
let mut suggestions = self.recipes.keys() let mut suggestions = self.recipes.keys()
.map(|suggestion| (edit_distance::edit_distance(suggestion, name), suggestion)) .map(|suggestion| (edit_distance::edit_distance(suggestion, name), suggestion))