clippy: replace transmute with &*

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2021-01-20 13:31:01 +01:00
parent d967d8f1a7
commit 8be65e34de
2 changed files with 2 additions and 2 deletions

View File

@ -194,7 +194,7 @@ impl IndexFile for DynamicIndexReader {
if pos >= self.index.len() {
None
} else {
Some(unsafe { std::mem::transmute(self.chunk_digest(pos).as_ptr()) })
Some(unsafe { &*(self.chunk_digest(pos).as_ptr() as *const [u8; 32]) })
}
}

View File

@ -166,7 +166,7 @@ impl IndexFile for FixedIndexReader {
if pos >= self.index_length {
None
} else {
Some(unsafe { std::mem::transmute(self.index.add(pos * 32)) })
Some(unsafe { &*(self.index.add(pos * 32) as *const [u8; 32]) })
}
}