Some minor cleanup
This commit is contained in:
parent
44a1d5ce9a
commit
ddf0963c65
@ -1,3 +1,4 @@
|
||||
#![forbid(unsafe_code)]
|
||||
//! Editor functionality
|
||||
use crate::terminal_helpers::*;
|
||||
|
||||
@ -251,7 +252,7 @@ impl Editor {
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
/// Convert stdin to specific keypresses
|
||||
fn read_key(&mut self) -> Option<KeyCode<char>> {
|
||||
fn read_key(&mut self) -> Option<KeyCode> {
|
||||
// --------------------------------------------------------------------
|
||||
// Match single character
|
||||
// --------------------------------------------------------------------
|
||||
@ -669,10 +670,9 @@ impl Editor {
|
||||
let mut buffer = String::new();
|
||||
let default_cb = &mut Self::_noop_prompt_cb;
|
||||
|
||||
let cb = if cb.is_some() {
|
||||
cb.unwrap()
|
||||
} else {
|
||||
default_cb
|
||||
let cb = match cb {
|
||||
Some(cb) => cb,
|
||||
None => default_cb,
|
||||
};
|
||||
|
||||
loop {
|
||||
|
Loading…
Reference in New Issue
Block a user