Skip to content
Snippets Groups Projects
Commit a2914124 authored by Per Lindgren's avatar Per Lindgren
Browse files

small test

parents
No related branches found
No related tags found
No related merge requests found
/target
use std::io::Read;
fn take_reader(r: &mut impl Read) {
let mut buf = [0; 2];
let _ = r.read(&mut buf).unwrap();
for i in buf.iter() {
println!("value = {}", i);
}
}
fn main() {
let mut b: &[u8] = "01is string will be read".as_bytes();
let mut b: &[u8] = &[1u8, 2, 3, 4];
// let mut b = &[1u8, 2, 3, 4];
take_reader(&mut b);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment