summaryrefslogtreecommitdiff
path: root/helix-term/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r--helix-term/src/ui/mod.rs3
-rw-r--r--helix-term/src/ui/prompt.rs2
2 files changed, 2 insertions, 3 deletions
diff --git a/helix-term/src/ui/mod.rs b/helix-term/src/ui/mod.rs
index 76ddaf89..47a68a18 100644
--- a/helix-term/src/ui/mod.rs
+++ b/helix-term/src/ui/mod.rs
@@ -263,8 +263,7 @@ pub mod completers {
pub fn setting(_editor: &Editor, input: &str) -> Vec<Completion> {
static KEYS: Lazy<Vec<String>> = Lazy::new(|| {
- serde_json::to_value(Config::default())
- .unwrap()
+ serde_json::json!(Config::default())
.as_object()
.unwrap()
.keys()
diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs
index 7744a161..beba8ce9 100644
--- a/helix-term/src/ui/prompt.rs
+++ b/helix-term/src/ui/prompt.rs
@@ -443,7 +443,7 @@ impl Prompt {
let input: Cow<str> = if self.line.is_empty() {
// latest value in the register list
self.history_register
- .and_then(|reg| cx.editor.registers.first(reg).cloned()) // TODO: can we avoid cloning?
+ .and_then(|reg| cx.editor.registers.first(reg))
.map(|entry| entry.into())
.unwrap_or_else(|| Cow::from(""))
} else {