Skip to content

Commit

Permalink
Example updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfishcode committed Feb 4, 2025
1 parent 2188b9d commit 37018bf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/new_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ use std::mem::MaybeUninit;

fn main() {
let mut buf = vec![0_u8; 3];
buf.reserve(32);
let _x: () = read(stdin(), extend(&mut buf)).unwrap();
let _x: (&mut [u8], &mut [MaybeUninit<u8>]) = read(stdin(), buf.spare_capacity_mut()).unwrap();
let _x: usize = read(stdin(), &mut buf).unwrap();
let _x: usize = read(stdin(), &mut *buf).unwrap();
let _x: usize = read(stdin(), &mut buf[..]).unwrap();
Expand Down

0 comments on commit 37018bf

Please sign in to comment.