From dc8d5d2f1eadb19d0351fa214400d7ec7ba31a20 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Fri, 2 Oct 2020 20:22:08 +0200 Subject: =?UTF-8?q?Small=20improvements=20=F0=9F=A7=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/parse/resolve.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/parse/resolve.rs') diff --git a/src/parse/resolve.rs b/src/parse/resolve.rs index 1b289b1e..df5a5d41 100644 --- a/src/parse/resolve.rs +++ b/src/parse/resolve.rs @@ -89,12 +89,12 @@ fn trim_and_split_raw(raw: &str) -> (Vec, bool) { let is_whitespace = |line: &String| line.chars().all(char::is_whitespace); // Trims a sequence of whitespace followed by a newline at the start. - if lines.first().map(is_whitespace).unwrap_or(false) { + if lines.first().map_or(false, is_whitespace) { lines.remove(0); } // Trims a newline followed by a sequence of whitespace at the end. - if lines.last().map(is_whitespace).unwrap_or(false) { + if lines.last().map_or(false, is_whitespace) { lines.pop(); } -- cgit v1.2.3