diff options
author | Blaž Hrastnik | 2021-03-31 14:42:16 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-03-31 14:42:16 +0000 |
commit | ceea5eacd814c5bbd8c6789610c87a882e3d72cf (patch) | |
tree | 1b8aef96c10764e761539b8f6fb15abc78f07a61 /helix-view/src/document.rs | |
parent | 15c9a33ebcc18f6abf983785032ffc9762c89203 (diff) |
clippy lint
Diffstat (limited to 'helix-view/src/document.rs')
-rw-r--r-- | helix-view/src/document.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index 93b5e854..d63e8591 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -242,7 +242,7 @@ impl Document { }); } - let success = self._apply(&transaction, view_id); + let success = self._apply(transaction, view_id); self.modified = true; // TODO: be smarter about modified by keeping track of saved version instead. That way if @@ -342,8 +342,7 @@ impl Document { self.language .as_ref() .and_then(|config| config.indent.as_ref()) - .map(|config| config.tab_width) - .unwrap_or(4) // fallback to 4 columns + .map_or(4, |config| config.tab_width) // fallback to 4 columns } /// Returns a string containing a single level of indentation. @@ -351,8 +350,7 @@ impl Document { self.language .as_ref() .and_then(|config| config.indent.as_ref()) - .map(|config| config.unit.as_str()) - .unwrap_or(" ") // fallback to 2 spaces + .map_or(" ", |config| config.unit.as_str()) // fallback to 2 spaces // " ".repeat(TAB_WIDTH) } |