Skip to content

Commit

Permalink
Fix iter tests to use the actual bytes IntoIter instead of std (#707)
Browse files Browse the repository at this point in the history
  • Loading branch information
paolobarbolini committed May 19, 2024
1 parent 4950c50 commit caf520a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_iter.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#![warn(rust_2018_idioms)]

use bytes::Bytes;
use bytes::{buf::IntoIter, Bytes};

#[test]
fn iter_len() {
let buf = Bytes::from_static(b"hello world");
let iter = buf.iter();
let iter = IntoIter::new(buf);

assert_eq!(iter.size_hint(), (11, Some(11)));
assert_eq!(iter.len(), 11);
}

#[test]
fn empty_iter_len() {
let buf = Bytes::from_static(b"");
let iter = buf.iter();
let buf = Bytes::new();
let iter = IntoIter::new(buf);

assert_eq!(iter.size_hint(), (0, Some(0)));
assert_eq!(iter.len(), 0);
Expand Down

0 comments on commit caf520a

Please sign in to comment.