Replace transmute following clippy's advice

Signed-off-by: Yilin Chen <sticnarf@gmail.com>
This commit is contained in:
Yilin Chen 2019-08-29 00:35:08 +08:00
parent d926300a45
commit b13a99dd30
1 changed files with 1 additions and 1 deletions

View File

@ -120,7 +120,7 @@ impl AsRef<Key> for Key {
impl AsRef<Key> for Vec<u8> {
fn as_ref(&self) -> &Key {
unsafe { std::mem::transmute(self) }
unsafe { &*(self as *const Vec<u8> as *const Key) }
}
}