pub fn is_compatible_with(&self, comparison: &Version) -> VersionCompatibility {
        let compatibility = match self.major {
            _ if self.major > comparison.major => {
                VersionCompatibility::DifferentMajor(VersionDifference::TooOld)
            }
            _ if self.major < comparison.major => {
                VersionCompatibility::DifferentMajor(VersionDifference::TooNew)
            }
            _ if self.minor > comparison.minor => {
                VersionCompatibility::DifferentMinor(VersionDifference::TooOld)
            }
            _ if self.minor < comparison.minor => {
                VersionCompatibility::DifferentMinor(VersionDifference::TooNew)
            }
            _ if self.patch > comparison.patch => {
                VersionCompatibility::DifferentPatch(VersionDifference::TooOld)
            }
            _ if self.patch < comparison.patch => {
                VersionCompatibility::DifferentPatch(VersionDifference::TooNew)
            }
            _ => VersionCompatibility::Identical,
        };
        // If we're in beta (0.x.x), any difference is tantamount to treason
        if self.major == 0 && !matches!(compatibility, VersionCompatibility::Identical) {
            // Here we figure out if the comparison version is too old or too new
            VersionCompatibility::DifferentBetaVersion(match compatibility {
                VersionCompatibility::DifferentMajor(version_difference) => version_difference,
                VersionCompatibility::DifferentMinor(version_difference) => version_difference,
                VersionCompatibility::DifferentPatch(version_difference) => version_difference,
                _ => panic!("Critical logic failure in version compatibility checks. You should report this as a bug."), // This shouldn't be possible, we know more than the compiler
            })
        } else {
            compatibility
        }
    }
// Compares this with another version returns their compatibility
// It will return an embedded version difference as to whether the version being compared to is too old/new or nothing if they're identical
Compares this with another version returns their compatibility
It will return an embedded version difference as to whether the version being compared to is too old/new or nothing if they're identical
Compares this with another version returns their compatibility It will return an embedded version difference as to whether the version being compared to is too old / new or nothing if they ' re identical
pub fn is_compatible_with(&self, comparison: &Version) -> VersionCompatibility {
        let compatibility = match self.major {
            _ if self.major > comparison.major => {
                VersionCompatibility::DifferentMajor(VersionDifference::TooOld)
            }
            _ if self.major < comparison.major => {
                VersionCompatibility::DifferentMajor(VersionDifference::TooNew)
            }
            _ if self.minor > comparison.minor => {
                VersionCompatibility::DifferentMinor(VersionDifference::TooOld)
            }
            _ if self.minor < comparison.minor => {
                VersionCompatibility::DifferentMinor(VersionDifference::TooNew)
            }
            _ if self.patch > comparison.patch => {
                VersionCompatibility::DifferentPatch(VersionDifference::TooOld)
            }
            _ if self.patch < comparison.patch => {
                VersionCompatibility::DifferentPatch(VersionDifference::TooNew)
            }
            _ => VersionCompatibility::Identical,
        };
        // If we're in beta (0.x.x), any difference is tantamount to treason
        if self.major == 0 && !matches!(compatibility, VersionCompatibility::Identical) {
            // Here we figure out if the comparison version is too old or too new
            VersionCompatibility::DifferentBetaVersion(match compatibility {
                VersionCompatibility::DifferentMajor(version_difference) => version_difference,
                VersionCompatibility::DifferentMinor(version_difference) => version_difference,
                VersionCompatibility::DifferentPatch(version_difference) => version_difference,
                _ => panic!("Critical logic failure in version compatibility checks. You should report this as a bug."), // This shouldn't be possible, we know more than the compiler
            })
        } else {
            compatibility
        }
    }
pub fn is_compatible_with ( & self , comparison : & Version ) -> VersionCompatibility { let compatibility = match self . major { _ if self . major > comparison . major => { VersionCompatibility :: DifferentMajor ( VersionDifference :: TooOld ) } _ if self . major < comparison . major => { VersionCompatibility :: DifferentMajor ( VersionDifference :: TooNew ) } _ if self . minor > comparison . minor => { VersionCompatibility :: DifferentMinor ( VersionDifference :: TooOld ) } _ if self . minor < comparison . minor => { VersionCompatibility :: DifferentMinor ( VersionDifference :: TooNew ) } _ if self . patch > comparison . patch => { VersionCompatibility :: DifferentPatch ( VersionDifference :: TooOld ) } _ if self . patch < comparison . patch => { VersionCompatibility :: DifferentPatch ( VersionDifference :: TooNew ) } _ => VersionCompatibility :: Identical , } ; // If we're in beta (0.x.x), any difference is tantamount to treason if self . major == 0 && ! matches ! ( compatibility VersionCompatibility Identical ) { // Here we figure out if the comparison version is too old or too new VersionCompatibility :: DifferentBetaVersion ( match compatibility { VersionCompatibility :: DifferentMajor ( version_difference ) => version_difference , VersionCompatibility :: DifferentMinor ( version_difference ) => version_difference , VersionCompatibility :: DifferentPatch ( version_difference ) => version_difference , _ => panic ! ( " " ) , // This shouldn't be possible, we know more than the compiler } ) } else { compatibility } }
Compares this with another version returns their compatibility
It will return an embedded version difference as to whether the version being compared to is too old/new or nothing if they're identical
Compares this with another version returns their compatibility It will return an embedded version difference as to whether the version being compared to is too old / new or nothing if they ' re identical
&self
comparison
&Version