stylo: We've had bitfield accessors for a while now.
draft
stylo: We've had bitfield accessors for a while now.
--- a/servo/components/style/gecko_string_cache/mod.rs
+++ b/servo/components/style/gecko_string_cache/mod.rs
@@ -151,21 +151,18 @@ impl WeakAtom {
unsafe {
(*self.as_ptr()).mIsStatic() != 0
}
}
/// Returns the length of the atom string.
#[inline]
pub fn len(&self) -> u32 {
- // FIXME(emilio): re-introduce bitfield accessors:
- //
- // https://github.com/servo/rust-bindgen/issues/519
unsafe {
- (*self.as_ptr())._bitfield_1 & 0x7FFFFFFF
+ (*self.as_ptr()).mLength()
}
}
/// Returns whether this atom is the empty string.
#[inline]
pub fn is_empty(&self) -> bool {
self.len() == 0
}