diff options
author | Blaž Hrastnik | 2022-06-20 20:47:48 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2022-06-21 17:26:24 +0000 |
commit | 23b5b1e25aca1dbed87fef18cc72b16852ba40a8 (patch) | |
tree | 21534a9c7ed846a51732b8cba59321e8ffdb8dac /helix-term/src/ui | |
parent | 19dccade7c44619bfa414a711fe72a612e4ca358 (diff) |
Remove a couple more unwraps
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r-- | helix-term/src/ui/mod.rs | 3 | ||||
-rw-r--r-- | helix-term/src/ui/prompt.rs | 2 |
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 { |