mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-16 02:00:51 +00:00
Switch from version strings to schema versions
Should help reduce some churn a bit!
This commit is contained in:
parent
1db5b3fb50
commit
98030e0e4a
@ -163,7 +163,7 @@ fn extract_programs(module: &mut Module) -> Vec<shared::Program> {
|
||||
panic!("failed to decode what looked like wasm-bindgen data: {}", e)
|
||||
}
|
||||
};
|
||||
if p.version != version {
|
||||
if p.schema_version != shared::SCHEMA_VERSION {
|
||||
panic!("
|
||||
|
||||
it looks like the Rust project used to create this wasm file was linked against
|
||||
|
@ -351,6 +351,7 @@ impl Program {
|
||||
})
|
||||
}),
|
||||
("version", &|a| a.str(&shared::version())),
|
||||
("schema_version", &|a| a.str(&shared::SCHEMA_VERSION)),
|
||||
]);
|
||||
a.cnt
|
||||
};
|
||||
|
@ -5,6 +5,8 @@ extern crate fnv;
|
||||
use std::char;
|
||||
use std::hash::{Hash, Hasher};
|
||||
|
||||
pub const SCHEMA_VERSION: &str = "0";
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct Program {
|
||||
pub exports: Vec<Export>,
|
||||
@ -12,6 +14,7 @@ pub struct Program {
|
||||
pub imports: Vec<Import>,
|
||||
pub custom_type_names: Vec<CustomTypeName>,
|
||||
pub version: String,
|
||||
pub schema_version: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
|
Loading…
x
Reference in New Issue
Block a user