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 8174770
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/auxiliary/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,11 @@ const INSTR_PROF_RAW_MAGIC_64: u64 = (255_u64 << 56)
| 129_u64;

fn perturb_header(path: &Path) {
let mut file = fs::OpenOptions::new().read(true).write(true).open(path).unwrap();
let mut file = fs::OpenOptions::new().read(true).write(true).open(path).unwrap(); // Not buffered because it is read and written only once each.
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 8174770

Please sign in to comment.