Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
wcampbell0x2a committed Aug 28, 2023
1 parent 6ba3930 commit e0f8089
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ struct DekuTest {
}

fn main() {
let data: Vec<u8> = vec![0b0110_1001, 0xBE, 0xEF];
let (_rest, mut val) = DekuTest::from_reader((data.as_ref(), 0)).unwrap();
let data: &[u8] = &[0b0110_1001, 0xBE, 0xEF];
let mut cursor = Cursor::new(data);
let (_amt_read, mut val) = DekuTest::from_reader((&mut cursor, 0)).unwrap();
assert_eq!(DekuTest {
field_a: 0b0110,
field_b: 0b1001,
Expand Down

0 comments on commit e0f8089

Please sign in to comment.