/// Compare two version number strings to each other.
/// This compares version `a` to version `b`, and returns whether version `a` is greater, less
/// or equal to version `b`.
///
/// The two given version numbers must be valid, or an error will be returned.
///
/// One of the following ok results may be returned:
///
/// * `CompOp::Eq`
/// * `CompOp::Lt`
/// * `CompOp::Gt`
///
/// # Examples
///
/// ```
/// use version_compare::{CompOp, VersionCompare};
///
/// // Compare version numbers
/// assert_eq!(VersionCompare::compare("1.2.3", "1.2.3"), Ok(CompOp::Eq));
/// assert_eq!(VersionCompare::compare("1.2.3", "1.2.4"), Ok(CompOp::Lt));
/// assert_eq!(VersionCompare::compare("1", "0.1"), Ok(CompOp::Gt));
/// ```
Compare two version number strings to each other.

The two given version numbers must be valid, or an error will be returned.

One of the following ok results may be returned.


Compare two version number strings to each other . The two given version numbers must be valid or an error will be returned . One of the following ok results may be returned .
pub fn compare(a: &str, b: &str) -> Result<CompOp, ()> {
        // Create version instances
        let a_ver = Version::from(a);
        let b_ver = Version::from(b);
        // Both version numbers must have been parsed
        if a_ver.is_none() || b_ver.is_none() {
            return Err(());
        }
        // Compare and return the result
        Ok(a_ver.unwrap().compare(&b_ver.unwrap()))
    }
pub fn compare ( a : & str , b : & str ) -> Result < CompOp , ( ) > { // Create version instances let a_ver = Version :: from ( a ) ; let b_ver = Version :: from ( b ) ; // Both version numbers must have been parsed if a_ver . is_none ( ) || b_ver . is_none ( ) { return Err ( ( ) ) ; } // Compare and return the result Ok ( a_ver . unwrap ( ) . compare ( & b_ver . unwrap ( ) ) ) }
Compare two version number strings to each other.
Compare two version number strings to each other .
a
&str
b
&str
examples
```
use version_compare::{CompOp, VersionCompare}.


` ` ` use version_compare :: { CompOp VersionCompare } .