use semver::{Version, SemVerError};
      
      fn main() -> Result<(), SemVerError> {
        let version_1 = Version::parse("1.0.0-alpha")?;
        let version_2 = Version::parse("1.0.0")?;
        assert!(version_1.is_prerelease());
        assert!(!version_2.is_prerelease());
        Ok(())
      }
      
      Rust language logo

      Check if pre-release

      Codiga's Rust Recipes

      works with semver format

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.