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

Model BidiAuxiliaryProperties as an EnumeratedProperty #5597

Merged
merged 6 commits into from
Sep 30, 2024

Conversation

robertbastian
Copy link
Member

No description provided.

younies
younies previously approved these changes Sep 25, 2024
Manishearth
Manishearth previously approved these changes Sep 30, 2024
}
fn from_unaligned(unaligned: Self::ULE) -> Self {
let [a, b, c] = unaligned.0;
TrieValue::try_from_u32(u32::from_le_bytes([a, b, c, 0])).unwrap_or_default()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm. a non-safety invariant of ZeroVec is that byte equality is equality, are we okay with giving that up here?

The worst that can happen is that == on ZeroVec will do unexpected things with bad data, but I'm overall fine with that. Either way, I think we should document that this breaks the invariant but is convenient

cc @sffc

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you think this is being given up here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unwrap_or_default() means that two unequal byte sequences will produce equal values

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right. I can write a custom ULE type?

@robertbastian robertbastian merged commit c697e33 into unicode-org:main Sep 30, 2024
28 checks passed
@robertbastian robertbastian deleted the bidi branch September 30, 2024 19:35
@robertbastian
Copy link
Member Author

#3573

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.

3 participants