Skip to content

Commit

Permalink
Remove io::Cursor, and implement Buf/BufMut for slices instead (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar authored and carllerche committed Jun 7, 2019
1 parent d813490 commit 55aa530
Show file tree
Hide file tree
Showing 15 changed files with 191 additions and 254 deletions.
3 changes: 1 addition & 2 deletions benches/buf.rs
Original file line number Diff line number Diff line change
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
Loading

0 comments on commit 55aa530

Please sign in to comment.