diff --git a/wasmer-it/src/ast.rs b/wasmer-it/src/ast.rs index 4c5d4c1..6f2c1cc 100644 --- a/wasmer-it/src/ast.rs +++ b/wasmer-it/src/ast.rs @@ -141,6 +141,22 @@ pub struct Interfaces<'input> { } impl Interfaces<'_> { + pub fn new() -> Self { + use std::str::FromStr; + + // it's safe because otherwise it won't compile + let version = semver::Version::from_str(env!("CARGO_PKG_VERSION")).unwrap(); + + Self { + version, + types: Vec::new(), + imports: Vec::new(), + adapters: Vec::new(), + exports: Vec::new(), + implementations: Vec::new(), + } + } + pub fn from_version(version: semver::Version) -> Self { Self { version,