From c20813690f962856efa1989576d9f7c91364f265 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Fri, 7 May 2021 14:40:11 +0900 Subject: View::new is infallible, so is editor.switch/new_file. --- helix-term/src/application.rs | 2 +- helix-term/src/commands.rs | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'helix-term/src') diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index 9838998a..ae7e22bd 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -52,7 +52,7 @@ impl Application { editor.open(file, Action::VerticalSplit)?; } } else { - editor.new_file(Action::VerticalSplit)?; + editor.new_file(Action::VerticalSplit); } compositor.push(Box::new(ui::EditorView::new())); diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 5c1021e1..addd7437 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -935,9 +935,7 @@ pub fn buffer_picker(cx: &mut Context) { }, |editor: &mut Editor, (id, _path): &(DocumentId, Option), _action| { use helix_view::editor::Action; - editor - .switch(*id, Action::Replace) - .expect("editor.open failed"); + editor.switch(*id, Action::Replace); }, ); cx.push_layer(Box::new(picker)); -- cgit v1.2.3-70-g09d2