wiggle-generate: add an empty constructor to ErrorTransform

some library users (me, in lucet-wasi) may not care about ErrorTransform YET
This commit is contained in:
Pat Hickey
2020-06-02 18:41:53 -07:00
parent dcb774a35e
commit 220733b974

View File

@@ -11,6 +11,9 @@ pub struct ErrorTransform {
} }
impl ErrorTransform { impl ErrorTransform {
pub fn empty() -> Self {
Self { m: Vec::new() }
}
pub fn new(conf: &ErrorConf, doc: &Document) -> Result<Self, Error> { pub fn new(conf: &ErrorConf, doc: &Document) -> Result<Self, Error> {
let mut richtype_identifiers = HashMap::new(); let mut richtype_identifiers = HashMap::new();
let m = conf.iter().map(|(ident, field)| let m = conf.iter().map(|(ident, field)|