diff options
author | Blaž Hrastnik | 2021-03-26 02:02:32 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-03-26 02:03:14 +0000 |
commit | ad3325db8e6dce3a10b9f8e0319ab9814c7ade1b (patch) | |
tree | b855b4ca22fccb6eb97f011af3f26372d5c8df1c /helix-term/src/commands.rs | |
parent | cf0e191a6a42a2382128765dc0ff1531ad9800af (diff) |
minor: Remove a few unwraps.
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r-- | helix-term/src/commands.rs | 6 |
1 files changed, 3 insertions, 3 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(), |