Skip to content

Commit

Permalink
Rust: Allow loading more recent libraries (#153)
Browse files Browse the repository at this point in the history
It should be legal to provide a bridgestan library that was compiled
with a later version of bridgestan, providing the major version
still matches.
  • Loading branch information
aseyboldt authored Jul 6, 2023
1 parent a97967a commit ad320eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rust/src/bs_safe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pub fn open_library<P: AsRef<OsStr>>(path: P) -> Result<StanLibrary> {
let self_minor: c_int = env!("CARGO_PKG_VERSION_MINOR").parse().unwrap();
let self_patch: c_int = env!("CARGO_PKG_VERSION_PATCH").parse().unwrap();

if (self_major != major) | (self_minor != minor) {
if !((self_major == major) & (self_minor <= minor)) {
return Err(BridgeStanError::BadLibraryVersion(
format!("{}.{}.{}", major, minor, patch),
format!("{}.{}.{}", self_major, self_minor, self_patch),
Expand Down

0 comments on commit ad320eb

Please sign in to comment.