From 86f4e22fc2ead6a99f296d5086aa7845cc9464a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Thu, 7 Sep 2017 15:37:43 +0200 Subject: [PATCH] stylo: Don't add boundary characters to the fixups specified in ServoBindings.toml This allows adjusting the fixups for the patches in bug 1393230 when using libclang 3.9. --- components/style/build_gecko.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/style/build_gecko.rs b/components/style/build_gecko.rs index de8daefd3ab..32ec46c1334 100644 --- a/components/style/build_gecko.rs +++ b/components/style/build_gecko.rs @@ -292,7 +292,7 @@ mod bindings { }, }; for fixup in fixups.iter() { - result = Regex::new(&format!(r"\b{}\b", fixup.pat)).unwrap().replace_all(&result, fixup.rep.as_str()) + result = Regex::new(&fixup.pat).unwrap().replace_all(&result, &*fixup.rep) .into_owned().into(); } let bytes = result.into_bytes(); @@ -426,7 +426,7 @@ mod bindings { let servo = item["servo"].as_str().unwrap(); let gecko_name = gecko.rsplit("::").next().unwrap(); fixups.push(Fixup { - pat: format!("root::{}", gecko), + pat: format!("\\broot::{}\\b", gecko), rep: format!("::gecko_bindings::structs::{}", gecko_name) }); builder.hide_type(gecko)