зеркало из
https://github.com/glebtv/tui-textarea.git
synced 2026-09-07 16:05:50 +03:00
use io::Result<T> instead of Result<T, io::Error> in bench
Этот коммит содержится в:
@@ -107,6 +107,7 @@ fn random(c: &mut Criterion) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Inserting a long line is slower than multiple short lines into `TextArea`
|
||||||
fn long(c: &mut Criterion) {
|
fn long(c: &mut Criterion) {
|
||||||
c.bench_function("insert::long::1_lorem", |b| {
|
c.bench_function("insert::long::1_lorem", |b| {
|
||||||
b.iter(|| black_box(append_long_lorem(1)))
|
b.iter(|| black_box(append_long_lorem(1)))
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ impl Default for DummyBackend {
|
|||||||
|
|
||||||
impl Backend for DummyBackend {
|
impl Backend for DummyBackend {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn draw<'a, I>(&mut self, _content: I) -> Result<(), io::Error>
|
fn draw<'a, I>(&mut self, _content: I) -> io::Result<()>
|
||||||
where
|
where
|
||||||
I: Iterator<Item = (u16, u16, &'a Cell)>,
|
I: Iterator<Item = (u16, u16, &'a Cell)>,
|
||||||
{
|
{
|
||||||
@@ -49,33 +49,33 @@ impl Backend for DummyBackend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn hide_cursor(&mut self) -> Result<(), io::Error> {
|
fn hide_cursor(&mut self) -> io::Result<()> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn show_cursor(&mut self) -> Result<(), io::Error> {
|
fn show_cursor(&mut self) -> io::Result<()> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn get_cursor(&mut self) -> Result<(u16, u16), io::Error> {
|
fn get_cursor(&mut self) -> io::Result<(u16, u16)> {
|
||||||
Ok(self.cursor)
|
Ok(self.cursor)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn set_cursor(&mut self, x: u16, y: u16) -> Result<(), io::Error> {
|
fn set_cursor(&mut self, x: u16, y: u16) -> io::Result<()> {
|
||||||
self.cursor = (x, y);
|
self.cursor = (x, y);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn clear(&mut self) -> Result<(), io::Error> {
|
fn clear(&mut self) -> io::Result<()> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn size(&self) -> Result<Rect, io::Error> {
|
fn size(&self) -> io::Result<Rect> {
|
||||||
Ok(Rect {
|
Ok(Rect {
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 0,
|
y: 0,
|
||||||
@@ -85,7 +85,7 @@ impl Backend for DummyBackend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn window_size(&mut self) -> Result<WindowSize, io::Error> {
|
fn window_size(&mut self) -> io::Result<WindowSize> {
|
||||||
Ok(WindowSize {
|
Ok(WindowSize {
|
||||||
columns_rows: Size {
|
columns_rows: Size {
|
||||||
width: self.width,
|
width: self.width,
|
||||||
@@ -99,7 +99,7 @@ impl Backend for DummyBackend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn flush(&mut self) -> Result<(), io::Error> {
|
fn flush(&mut self) -> io::Result<()> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user