Use usize and u32 for LayerId.

This commit is contained in:
Ms2ger 2015-03-27 17:55:20 +01:00
parent ac3c076892
commit 37c271a260
3 changed files with 6 additions and 9 deletions

View file

@ -311,12 +311,9 @@ pub trait Flow: fmt::Debug + Sync {
/// Returns a layer ID for the given fragment.
#[allow(unsafe_code)]
fn layer_id(&self, fragment_id: uint) -> LayerId {
unsafe {
let obj = mem::transmute::<&&Self, &raw::TraitObject>(&self);
let pointer: uint = mem::transmute(obj.data);
LayerId(pointer, fragment_id)
}
fn layer_id(&self, fragment_id: u32) -> LayerId {
let obj = unsafe { mem::transmute::<&&Self, &raw::TraitObject>(&self) };
LayerId(obj.data as usize, fragment_id)
}
/// Attempts to perform incremental fixup of this flow by replacing its fragment's style with