From c23a457e72abe608715ac76f076f47dc42af07a5 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 20:31:44 +0200 Subject: Merging upstream version 1.74.1+dfsg1. Signed-off-by: Daniel Baumann --- vendor/anstream/benches/stream.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'vendor/anstream/benches/stream.rs') diff --git a/vendor/anstream/benches/stream.rs b/vendor/anstream/benches/stream.rs index 55c20b896..f89aacf5f 100644 --- a/vendor/anstream/benches/stream.rs +++ b/vendor/anstream/benches/stream.rs @@ -15,7 +15,7 @@ fn stream(c: &mut Criterion) { let mut group = c.benchmark_group(name); group.bench_function("nop", |b| { b.iter(|| { - let buffer = anstream::Buffer::with_capacity(content.len()); + let buffer = Vec::with_capacity(content.len()); let mut stream = buffer; stream.write_all(content).unwrap(); @@ -25,7 +25,7 @@ fn stream(c: &mut Criterion) { }); group.bench_function("StripStream", |b| { b.iter(|| { - let buffer = anstream::Buffer::with_capacity(content.len()); + let buffer = Vec::with_capacity(content.len()); let mut stream = anstream::StripStream::new(buffer); stream.write_all(content).unwrap(); @@ -36,9 +36,8 @@ fn stream(c: &mut Criterion) { #[cfg(all(windows, feature = "wincon"))] group.bench_function("WinconStream", |b| { b.iter(|| { - let buffer = anstream::Buffer::with_capacity(content.len()); - let mut stream = - anstream::WinconStream::new(anstyle_wincon::Console::new(buffer).unwrap()); + let buffer = Vec::with_capacity(content.len()); + let mut stream = anstream::WinconStream::new(buffer); stream.write_all(content).unwrap(); @@ -47,7 +46,7 @@ fn stream(c: &mut Criterion) { }); group.bench_function("AutoStream::always_ansi", |b| { b.iter(|| { - let buffer = anstream::Buffer::with_capacity(content.len()); + let buffer = Vec::with_capacity(content.len()); let mut stream = anstream::AutoStream::always_ansi(buffer); stream.write_all(content).unwrap(); @@ -57,7 +56,7 @@ fn stream(c: &mut Criterion) { }); group.bench_function("AutoStream::always", |b| { b.iter(|| { - let buffer = anstream::Buffer::with_capacity(content.len()); + let buffer = Vec::with_capacity(content.len()); let mut stream = anstream::AutoStream::always(buffer); stream.write_all(content).unwrap(); @@ -67,7 +66,7 @@ fn stream(c: &mut Criterion) { }); group.bench_function("AutoStream::never", |b| { b.iter(|| { - let buffer = anstream::Buffer::with_capacity(content.len()); + let buffer = Vec::with_capacity(content.len()); let mut stream = anstream::AutoStream::never(buffer); stream.write_all(content).unwrap(); -- cgit v1.2.3