compare

Function compare 

Source
pub fn compare(version1: &str, operator: &str, version2: &str) -> Result<bool>
Expand description

Compare two versions using the specified operator.

§Arguments

  • version1 - First version string (will be normalized)
  • operator - Comparison operator (“>”, “>=”, “<”, “<=”, “==”, “=”, “!=”, “<>”)
  • version2 - Second version string (will be normalized)

§Returns

true if the comparison holds, false otherwise.

§Errors

Returns an error if either version string is invalid.