aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/document.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-view/src/document.rs')
-rw-r--r--helix-view/src/document.rs8
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)
}