mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
clippy: fix warnings in various modules in components (#31568)
* clippy: fix warnings in various modules in components * fix: unit tests * fix: build on android * fix: all samplers use new_boxed
This commit is contained in:
parent
19f1f2a8f4
commit
3a5ca785d3
24 changed files with 107 additions and 118 deletions
|
@ -31,16 +31,16 @@ fn main() {
|
|||
println!("Binding generation completed in {:?}", start.elapsed());
|
||||
|
||||
let json = out_dir.join("InterfaceObjectMapData.json");
|
||||
let json: Value = serde_json::from_reader(File::open(&json).unwrap()).unwrap();
|
||||
let json: Value = serde_json::from_reader(File::open(json).unwrap()).unwrap();
|
||||
let mut map = phf_codegen::Map::new();
|
||||
for (key, value) in json.as_object().unwrap() {
|
||||
map.entry(Bytes(key), value.as_str().unwrap());
|
||||
}
|
||||
let phf = PathBuf::from(env::var_os("OUT_DIR").unwrap()).join("InterfaceObjectMapPhf.rs");
|
||||
let mut phf = File::create(&phf).unwrap();
|
||||
write!(
|
||||
let mut phf = File::create(phf).unwrap();
|
||||
writeln!(
|
||||
&mut phf,
|
||||
"pub static MAP: phf::Map<&'static [u8], fn(JSContext, HandleObject)> = {};\n",
|
||||
"pub static MAP: phf::Map<&'static [u8], fn(JSContext, HandleObject)> = {};",
|
||||
map.build(),
|
||||
)
|
||||
.unwrap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue