Skip to content

Commit

Permalink
fix: ignore pre-release for version comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
nsarlin-zama committed Jul 18, 2024
1 parent 163de4e commit d96e53d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::{
path::{Path, PathBuf},
};

use semver::Prerelease;
#[cfg(feature = "load")]
use semver::{Version, VersionReq};
#[cfg(feature = "load")]
Expand Down Expand Up @@ -394,7 +395,10 @@ pub struct Testcase {
#[cfg(feature = "load")]
impl Testcase {
pub fn is_valid_for_version(&self, version: &str) -> bool {
let tfhe_version = Version::parse(version).unwrap();
let mut tfhe_version = Version::parse(version).unwrap();

// Removes the pre-release tag because matches will always return
tfhe_version.pre = Prerelease::EMPTY;

let req = format!(">={}", self.tfhe_version_min);
let min_version = VersionReq::parse(&req).unwrap();
Expand Down

0 comments on commit d96e53d

Please sign in to comment.