From 5197d769bb2fea50975122a4ebba89c07c712839 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Sat, 27 Mar 2021 16:55:31 -0600 Subject: don't builder when we don't need to builder --- src/makefile/mod.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/makefile') diff --git a/src/makefile/mod.rs b/src/makefile/mod.rs index e07cdfd..1ce335d 100644 --- a/src/makefile/mod.rs +++ b/src/makefile/mod.rs @@ -84,15 +84,15 @@ impl<'a> Makefile<'a> { } } - pub fn and_read_file(&mut self, path: impl AsRef) -> &mut Self { + pub fn and_read_file(&mut self, path: impl AsRef) { let file = File::open(path); // TODO handle errors let file = file.expect("couldn't open makefile!"); let file_reader = BufReader::new(file); - self.and_read(file_reader) + self.and_read(file_reader); } - pub fn and_read(&mut self, source: impl BufRead) -> &mut Self { + pub fn and_read(&mut self, source: impl BufRead) { let mut lines_iter = source.lines().enumerate().peekable(); while let Some((line_number, line)) = lines_iter.next() { // TODO handle I/O errors at all @@ -356,7 +356,6 @@ impl<'a> Makefile<'a> { } } } - self } fn special_target_has_prereq(&self, target: &str, name: &str) -> bool { -- cgit v1.2.3