diff options
Diffstat (limited to 'helix-term/src')
-rw-r--r-- | helix-term/src/commands.rs | 6 | ||||
-rw-r--r-- | helix-term/src/ui/prompt.rs | 4 |
2 files changed, 4 insertions, 6 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index dd7de06e..5fdf6a0a 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -831,12 +831,12 @@ pub fn buffer_picker(cx: &mut Context) { .collect(), move |(id, path): &(DocumentId, Option<PathBuf>)| { // format_fn - match path { + match path.as_ref().and_then(|path| path.to_str()) { Some(path) => { if *id == current { - format!("{} (*)", path.to_str().unwrap()).into() + format!("{} (*)", path).into() } else { - path.to_str().unwrap().into() + path.into() } } None => "[NEW]".into(), diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs index 8b3a1ca2..c61f0bd1 100644 --- a/helix-term/src/ui/prompt.rs +++ b/helix-term/src/ui/prompt.rs @@ -130,9 +130,7 @@ impl Prompt { theme.get("ui.statusline"), ); for (i, (_range, completion)) in self.completion.iter().enumerate() { - let color = if self.completion_selection_index.is_some() - && i == self.completion_selection_index.unwrap() - { + let color = if Some(i) == self.completion_selection_index { Style::default().bg(Color::Rgb(104, 60, 232)) } else { text_color |