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

PartialOrd fix for ArchivedVec. #462

Merged
merged 1 commit into from
Jan 15, 2024
Merged

Conversation

gz
Copy link
Contributor

@gz gz commented Jan 11, 2024

Without it, I couldn't get e.g., this to compile since it couldn't compare Vec with ArchivedVec:

#[derive(Debug, Clone, Archive, Serialize, Deserialize)]
#[archive_attr(derive(Clone, Ord, Eq, PartialEq, PartialOrd))]
#[archive(compare(PartialEq, PartialOrd))]
pub struct PersonalNetworkGkgEntry {
    pub people: Vec<String>,
}

(FYI I hope that this partial_ord impl is actually correct since I haven't written any PartialOrd for slices/vectors before so definitely good to double check :O)

Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
@djkoloski
Copy link
Collaborator

Yep, this looks about the same as the PartialOrd impl for slice.

@djkoloski djkoloski merged commit 3e7d780 into rkyv:main Jan 15, 2024
0 of 19 checks passed
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.

None yet

2 participants