Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for easier version compatibility checking. #286

Conversation

iddm
Copy link
Collaborator

@iddm iddm commented Feb 28, 2023

By deriving Ord and PartialOrd we can compare two versions easier. We need to be able to compare the versions to make sure the compatible version is used with the module.

By deriving Ord and PartialOrd we can compare two versions easier.
We need to be able to compare the versions to make sure the compatible
version is used with the module.
@iddm
Copy link
Collaborator Author

iddm commented Feb 28, 2023

An example:

fn main() {
    #[derive(Debug, PartialEq, Eq, Ord, PartialOrd)]
    pub struct Version {
        pub major: i32,
        pub minor: i32,
        pub patch: i32,
    }
    
    let redis = Version {
        major: 6,
        minor: 0,
        patch: 3,
    };
    let gears = Version {
        major: 7,
        minor: 0,
        patch: 3,
    };
    
    println!("Result: {:?}", redis.cmp(&gears));
}

@iddm iddm merged commit 10572ff into RedisLabsModules:api_extentions Feb 28, 2023
@iddm iddm deleted the allow-for-easier-version-compatibility-checking branch February 28, 2023 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants