Skip to content

Commit

Permalink
tests: Remove needless vec
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Jan 30, 2025
1 parent fb528c9 commit 35d1873
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/auxiliary/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ const INSTR_PROF_RAW_MAGIC_64: u64 = (255_u64 << 56)
fn perturb_header(path: &Path) {
let mut file = fs::OpenOptions::new().read(true).write(true).open(path).unwrap();
let mut magic = {
let mut buf = vec![0_u8; mem::size_of::<u64>()];
let mut buf = [0_u8; mem::size_of::<u64>()];
file.read_exact(&mut buf).unwrap();
u64::from_ne_bytes(buf.try_into().unwrap())
u64::from_ne_bytes(buf)
};
assert_eq!(magic, INSTR_PROF_RAW_MAGIC_64);
magic += 1;
Expand Down

0 comments on commit 35d1873

Please sign in to comment.