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:
eri 2024-03-08 15:28:04 +01:00 committed by GitHub
parent 19f1f2a8f4
commit 3a5ca785d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 107 additions and 118 deletions

View file

@ -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();