summaryrefslogtreecommitdiffstats
path: root/vendor/anstream/benches/stream.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /vendor/anstream/benches/stream.rs
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/anstream/benches/stream.rs')
-rw-r--r--vendor/anstream/benches/stream.rs15
1 files changed, 7 insertions, 8 deletions
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();