diff --git a/bench/benches/insert.rs b/bench/benches/insert.rs index cecbbad..994c036 100644 --- a/bench/benches/insert.rs +++ b/bench/benches/insert.rs @@ -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) { c.bench_function("insert::long::1_lorem", |b| { b.iter(|| black_box(append_long_lorem(1))) diff --git a/bench/src/lib.rs b/bench/src/lib.rs index 92b2b24..480fd54 100644 --- a/bench/src/lib.rs +++ b/bench/src/lib.rs @@ -41,7 +41,7 @@ impl Default for DummyBackend { impl Backend for DummyBackend { #[inline] - fn draw<'a, I>(&mut self, _content: I) -> Result<(), io::Error> + fn draw<'a, I>(&mut self, _content: I) -> io::Result<()> where I: Iterator, { @@ -49,33 +49,33 @@ impl Backend for DummyBackend { } #[inline] - fn hide_cursor(&mut self) -> Result<(), io::Error> { + fn hide_cursor(&mut self) -> io::Result<()> { Ok(()) } #[inline] - fn show_cursor(&mut self) -> Result<(), io::Error> { + fn show_cursor(&mut self) -> io::Result<()> { Ok(()) } #[inline] - fn get_cursor(&mut self) -> Result<(u16, u16), io::Error> { + fn get_cursor(&mut self) -> io::Result<(u16, u16)> { Ok(self.cursor) } #[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); Ok(()) } #[inline] - fn clear(&mut self) -> Result<(), io::Error> { + fn clear(&mut self) -> io::Result<()> { Ok(()) } #[inline] - fn size(&self) -> Result { + fn size(&self) -> io::Result { Ok(Rect { x: 0, y: 0, @@ -85,7 +85,7 @@ impl Backend for DummyBackend { } #[inline] - fn window_size(&mut self) -> Result { + fn window_size(&mut self) -> io::Result { Ok(WindowSize { columns_rows: Size { width: self.width, @@ -99,7 +99,7 @@ impl Backend for DummyBackend { } #[inline] - fn flush(&mut self) -> Result<(), io::Error> { + fn flush(&mut self) -> io::Result<()> { Ok(()) } }