Skip to content

Commit aed92eb

Browse files
author
Guy Bedford
authored
gen-host-js: auto loading behaviour, based on --base64-cutoff for inlining (#425)
In addition, --instantiation now supports a third instantiateCore optional argument to replace the --load=custom wrapping use case
1 parent b66df4d commit aed92eb

4 files changed

Lines changed: 147 additions & 167 deletions

File tree

crates/bindgen-core/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,13 @@ impl Files {
245245
}
246246
}
247247

248+
pub fn get_size(&mut self, name: &str) -> Option<usize> {
249+
match self.files.get(name) {
250+
Some(data) => Some(data.len()),
251+
None => None,
252+
}
253+
}
254+
248255
pub fn remove(&mut self, name: &str) -> Option<Vec<u8>> {
249256
return self.files.remove(name);
250257
}

0 commit comments

Comments
 (0)