Fix clippy

imgbot
Wojciech Kępka 4 years ago committed by Blaž Hrastnik
parent 52d3c29244
commit b9100fbd44

@ -914,11 +914,9 @@ mod cmd {
fn quit(editor: &mut Editor, args: &[&str], event: PromptEvent) { fn quit(editor: &mut Editor, args: &[&str], event: PromptEvent) {
// last view and we have unsaved changes // last view and we have unsaved changes
if editor.tree.views().count() == 1 { if editor.tree.views().count() == 1 && _buffers_remaining(editor) {
if _buffers_remaining(editor) {
return; return;
} }
}
editor.close(editor.view().id, /* close_buffer */ false); editor.close(editor.view().id, /* close_buffer */ false);
} }
@ -1056,11 +1054,9 @@ mod cmd {
editor.set_error(errors); editor.set_error(errors);
if quit { if quit {
if !force { if !force && _buffers_remaining(editor) {
if _buffers_remaining(editor) {
return; return;
} }
}
// close all views // close all views
let views: Vec<_> = editor.tree.views().map(|(view, _)| view.id).collect(); let views: Vec<_> = editor.tree.views().map(|(view, _)| view.id).collect();
@ -1083,11 +1079,9 @@ mod cmd {
} }
fn _quit_all(editor: &mut Editor, args: &[&str], event: PromptEvent, force: bool) { fn _quit_all(editor: &mut Editor, args: &[&str], event: PromptEvent, force: bool) {
if !force { if !force && _buffers_remaining(editor) {
if _buffers_remaining(editor) {
return; return;
} }
}
// close all views // close all views
let views: Vec<_> = editor.tree.views().map(|(view, _)| view.id).collect(); let views: Vec<_> = editor.tree.views().map(|(view, _)| view.id).collect();

Loading…
Cancel
Save