Update Module::custom_sections to properly return multiples

This commit is contained in:
Mark McCaskey
2020-03-23 14:12:07 -07:00
parent 59bd6f6e86
commit 9829d97d7d

View File

@ -273,14 +273,9 @@ impl Module {
} }
/// Get the custom sections matching the given name. /// Get the custom sections matching the given name.
pub fn custom_sections(&self, key: impl AsRef<str>) -> Option<Vec<&[u8]>> { pub fn custom_sections(&self, key: impl AsRef<str>) -> Option<&[Vec<u8>]> {
let key = key.as_ref(); let key = key.as_ref();
// TODO: handle multiple better when our system does self.inner.info.custom_sections.get(key).map(|v| v.as_ref())
self.inner
.info
.custom_sections
.get(key)
.map(|v| vec![v.as_ref()])
} }
} }