Code format cleanup

This commit is contained in:
Timothy Warren 2019-09-03 16:20:00 -04:00
parent dcd0c3bec1
commit 3ae040f1fc

View File

@ -278,7 +278,11 @@ impl Editor {
// Input
// ------------------------------------------------------------------------
fn prompt(&mut self, prompt: &str, cb: Option<&mut dyn Fn(&mut Self, &str, EditorKey<char>)>) -> String {
fn prompt(
&mut self,
prompt: &str,
cb: Option<&mut dyn Fn(&mut Self, &str, EditorKey<char>)>,
) -> String {
let mut buffer = String::new();
let default_cb = &mut Self::_noop_prompt_cb;
@ -298,10 +302,10 @@ impl Editor {
match char {
Backspace => {
buffer.pop();
},
}
DeleteKey => {
buffer.pop();
},
}
Escape => {
self.set_status_message("");
cb(self, &String::from(""), char);
@ -870,7 +874,7 @@ impl Editor {
self.filename = self.prompt("Save as (ESC to cancel):", None);
if self.filename.len() == 0 {
self.set_status_message("Save aborted");
return Ok(())
return Ok(());
}
}