style: Remove unnecessary mem::transmute in MediaListKey.

Differential Revision: https://phabricator.services.mozilla.com/D16147
This commit is contained in:
Cameron McCormack 2019-01-10 06:01:03 +00:00 committed by Emilio Cobos Álvarez
parent c04a4140a7
commit 7efbd9cde6

View file

@ -38,10 +38,8 @@ impl MediaListKey {
pub trait ToMediaListKey: Sized { pub trait ToMediaListKey: Sized {
/// Get a `MediaListKey` for this item. This key needs to uniquely identify /// Get a `MediaListKey` for this item. This key needs to uniquely identify
/// the item. /// the item.
#[allow(unsafe_code)]
fn to_media_list_key(&self) -> MediaListKey { fn to_media_list_key(&self) -> MediaListKey {
use std::mem; MediaListKey(self as *const Self as usize)
MediaListKey(unsafe { mem::transmute(self as *const Self) })
} }
} }