diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-10-02 20:22:08 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-10-02 20:22:08 +0200 |
| commit | dc8d5d2f1eadb19d0351fa214400d7ec7ba31a20 (patch) | |
| tree | 64c0ebb599c480270ac529edbc14b02534853828 /src/parse/resolve.rs | |
| parent | 904bc392abdcd7c48fa4541594f6218168afb61f (diff) | |
Small improvements 🧺
Diffstat (limited to 'src/parse/resolve.rs')
| -rw-r--r-- | src/parse/resolve.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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<String>, 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(); } |
