Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove io::Cursor, and implement Buf/BufMut for slices instead #261

Merged
merged 1 commit into from Jun 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions benches/buf.rs
Expand Up @@ -5,7 +5,6 @@ extern crate test;

use test::Bencher;
use bytes::Buf;
use std::io::Cursor;

/// Dummy Buf implementation
struct TestBuf {
Expand Down Expand Up @@ -120,7 +119,7 @@ macro_rules! bench {
#[bench]
fn $fname(b: &mut Bencher) {
// buf must be long enough for one read of 8 bytes starting at pos 7
let mut buf = Cursor::new(vec![1u8; 8+7]);
let mut buf = [1u8; 8+7];
b.iter(|| {
for i in 0..8 {
buf.set_position(i);
Expand Down