wasm-override: Support checking spec_name (#10380)

This adds support to the wasm-override feature to compare the spec_name. If the spec_name doesn't
match, a warning will be printed and the override will be ignored.
This commit is contained in:
Bastian Köcher
2021-12-03 11:29:51 +01:00
committed by GitHub
parent 9756615d5b
commit 6a770dfda1
3 changed files with 118 additions and 34 deletions
@@ -92,6 +92,18 @@ impl AsRef<[u8]> for RuntimeString {
}
}
#[cfg(feature = "std")]
impl std::ops::Deref for RuntimeString {
type Target = str;
fn deref(&self) -> &str {
match self {
Self::Borrowed(val) => &val,
Self::Owned(val) => &val,
}
}
}
impl Encode for RuntimeString {
fn encode(&self) -> Vec<u8> {
match self {