Update geckolib build-time bindgen build script for recent regex changes.

This commit is contained in:
Cameron McCormack 2017-01-17 16:59:30 +08:00
parent 363f590019
commit d4023a32d4

View file

@ -91,7 +91,7 @@ mod bindings {
added_paths.insert(path); added_paths.insert(path);
// Find all includes and add them recursively // Find all includes and add them recursively
for cap in INCLUDE_RE.captures_iter(&content) { for cap in INCLUDE_RE.captures_iter(&content) {
if let Some(path) = search_include(cap.at(1).unwrap()) { if let Some(path) = search_include(cap.get(1).unwrap().as_str()) {
add_headers_recursively(path, added_paths); add_headers_recursively(path, added_paths);
} }
} }
@ -212,7 +212,8 @@ mod bindings {
} }
let mut result = builder.generate().expect("Unable to generate bindings").to_string(); let mut result = builder.generate().expect("Unable to generate bindings").to_string();
for fixup in fixups.iter() { 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(&format!(r"\b{}\b", fixup.pat)).unwrap().replace_all(&result, fixup.rep.as_str())
.into_owned().into();
} }
File::create(&out_file).unwrap().write_all(&result.into_bytes()).expect("Unable to write output"); File::create(&out_file).unwrap().write_all(&result.into_bytes()).expect("Unable to write output");
} }