aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXidorn Quan <me@upsuper.org>2017-05-16 09:47:23 +1000
committerXidorn Quan <me@upsuper.org>2017-05-16 14:42:45 +1000
commit0667287bf60683d444bfd8d7da6ddcf027c4d4f3 (patch)
treed0ba7f89755156037e543492e4d6d6d283504535
parent9354e90afc84b25f30d9b6c6b490cdc66dc80c33 (diff)
downloadservo-0667287bf60683d444bfd8d7da6ddcf027c4d4f3.tar.gz
servo-0667287bf60683d444bfd8d7da6ddcf027c4d4f3.zip
Relax the requirement of Atom::with.
-rw-r--r--components/style/gecko/snapshot_helpers.rs2
-rw-r--r--components/style/gecko_string_cache/mod.rs2
-rw-r--r--components/style/properties/longhand/font.mako.rs2
-rw-r--r--ports/geckolib/glue.rs2
4 files changed, 4 insertions, 4 deletions
diff --git a/components/style/gecko/snapshot_helpers.rs b/components/style/gecko/snapshot_helpers.rs
index 9216c92cd2f..f7a0efa48c0 100644
--- a/components/style/gecko/snapshot_helpers.rs
+++ b/components/style/gecko/snapshot_helpers.rs
@@ -47,7 +47,7 @@ pub fn each_class<F, T>(item: T,
let length = getter(item, &mut class, &mut list);
match length {
0 => {}
- 1 => Atom::with(class, &mut callback),
+ 1 => Atom::with(class, callback),
n => {
let classes = slice::from_raw_parts(list, n as usize);
for c in classes {
diff --git a/components/style/gecko_string_cache/mod.rs b/components/style/gecko_string_cache/mod.rs
index 428d522be11..fa89f5eab48 100644
--- a/components/style/gecko_string_cache/mod.rs
+++ b/components/style/gecko_string_cache/mod.rs
@@ -198,7 +198,7 @@ impl fmt::Display for WeakAtom {
impl Atom {
/// Execute a callback with the atom represented by `ptr`.
- pub unsafe fn with<F, R: 'static>(ptr: *mut nsIAtom, callback: &mut F) -> R where F: FnMut(&Atom) -> R {
+ pub unsafe fn with<F, R>(ptr: *mut nsIAtom, callback: F) -> R where F: FnOnce(&Atom) -> R {
let atom = Atom(WeakAtom::new(ptr));
let ret = callback(&atom);
mem::forget(atom);
diff --git a/components/style/properties/longhand/font.mako.rs b/components/style/properties/longhand/font.mako.rs
index 44e49ac1fb7..aed5221e4b6 100644
--- a/components/style/properties/longhand/font.mako.rs
+++ b/components/style/properties/longhand/font.mako.rs
@@ -721,7 +721,7 @@ ${helpers.single_keyword_system("font-variant-caps",
// XXXManishearth handle quirks mode
let ref gecko_font = cx.style().get_font().gecko();
- let base_size = unsafe { Atom::with(gecko_font.mLanguage.raw::<nsIAtom>(), &mut |atom| {
+ let base_size = unsafe { Atom::with(gecko_font.mLanguage.raw::<nsIAtom>(), |atom| {
cx.font_metrics_provider.get_size(atom, gecko_font.mGenericID).0
}) };
diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs
index 2d40842b0bb..ca5a66c5405 100644
--- a/ports/geckolib/glue.rs
+++ b/ports/geckolib/glue.rs
@@ -2411,7 +2411,7 @@ pub extern "C" fn Servo_StyleSet_ResolveForDeclarations(raw_data: RawServoStyleS
pub extern "C" fn Servo_StyleSet_MightHaveAttributeDependency(raw_data: RawServoStyleSetBorrowed,
local_name: *mut nsIAtom) -> bool {
let data = PerDocumentStyleData::from_ffi(raw_data).borrow();
- unsafe { Atom::with(local_name, &mut |atom| data.stylist.might_have_attribute_dependency(atom)) }
+ unsafe { Atom::with(local_name, |atom| data.stylist.might_have_attribute_dependency(atom)) }
}
#[no_mangle]