Sha256: 665e1837c1294d7695ffa352a666ce8673fb46fa603164556524e87d5517a6cb

Contents?: true

Size: 434 Bytes

Versions: 8

Compression:

Stored size: 434 Bytes

Contents

#![warn(rust_2018_idioms)]

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

#[test]
fn iter_len() {
    let buf = Bytes::from_static(b"hello world");
    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::new();
    let iter = IntoIter::new(buf);

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
wasmtime-29.0.0 ./ext/cargo-vendor/bytes-1.9.0/tests/test_iter.rs
wasmtime-28.0.0 ./ext/cargo-vendor/bytes-1.9.0/tests/test_iter.rs
wasmtime-27.0.0 ./ext/cargo-vendor/bytes-1.8.0/tests/test_iter.rs
wasmtime-26.0.0 ./ext/cargo-vendor/bytes-1.8.0/tests/test_iter.rs
wasmtime-25.0.2 ./ext/cargo-vendor/bytes-1.7.1/tests/test_iter.rs
wasmtime-25.0.1 ./ext/cargo-vendor/bytes-1.7.1/tests/test_iter.rs
wasmtime-25.0.0 ./ext/cargo-vendor/bytes-1.7.1/tests/test_iter.rs
wasmtime-24.0.0 ./ext/cargo-vendor/bytes-1.7.1/tests/test_iter.rs