1
0
зеркало из https://github.com/glebtv/tui-textarea.git synced 2026-09-03 22:35:50 +03:00

prefer Into::into to From::from

Этот коммит содержится в:
rhysd
2022-07-09 12:38:05 +09:00
родитель e11a97ce49
Коммит ea377db4ee
7 изменённых файлов: 17 добавлений и 12 удалений

Просмотреть файл

@@ -260,7 +260,7 @@ impl<'a> Editor<'a> {
if search_height > 0 {
let textarea = &mut self.buffers[self.current].textarea;
match Input::from(crossterm::event::read()?) {
match crossterm::event::read()?.into() {
Input {
key: Key::Char('g' | 'n'),
ctrl: true,
@@ -307,7 +307,7 @@ impl<'a> Editor<'a> {
}
}
} else {
match Input::from(crossterm::event::read()?) {
match crossterm::event::read()?.into() {
Input {
key: Key::Char('q'),
ctrl: true,

Просмотреть файл

@@ -28,7 +28,7 @@ fn main() -> io::Result<()> {
term.draw(|f| {
f.render_widget(textarea.widget(), f.size());
})?;
match Input::from(crossterm::event::read()?) {
match crossterm::event::read()?.into() {
Input { key: Key::Esc, .. } => break,
input => {
textarea.input(input);

Просмотреть файл

@@ -48,7 +48,7 @@ fn main() -> io::Result<()> {
f.render_widget(widget, chunks[0]);
})?;
match Input::from(crossterm::event::read()?) {
match crossterm::event::read()?.into() {
Input { key: Key::Esc, .. } => break,
Input {
key: Key::Enter, ..

Просмотреть файл

@@ -59,7 +59,7 @@ fn main() -> io::Result<()> {
f.render_widget(widget, chunk);
}
})?;
match Input::from(crossterm::event::read()?) {
match crossterm::event::read()?.into() {
Input { key: Key::Esc, .. } => break,
Input {
key: Key::Char('x'),

Просмотреть файл

@@ -36,7 +36,7 @@ fn main() -> io::Result<()> {
.split(f.size());
f.render_widget(textarea.widget(), chunks[0]);
})?;
match Input::from(crossterm::event::read()?) {
match crossterm::event::read()?.into() {
Input { key: Key::Esc, .. } => break,
input => {
textarea.input(input);