-
Notifications
You must be signed in to change notification settings - Fork 9
Add method to return ISO15924 tag as u32
#24
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
Conversation
Signed-off-by: Nico Burns <[email protected]>
2eb5038
to
3447343
Compare
src/lib.rs
Outdated
@@ -38,6 +38,12 @@ impl Script { | |||
Self::inner_from_short_name(input) | |||
} | |||
|
|||
/// The 4-byte iso15924 tag as a `u32` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: document as big-endian?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: document as big-endian?
Might be a stupid question, but doesn't u32::from_be_bytes
convert to a native endian u32?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... yeah I think so. Perhaps this API ought return [u8; 4]
to avoid ambiguity.
Signed-off-by: Nico Burns <[email protected]>
@Manishearth Any chance of a release with these changes? |
…t for harfbuzz (#38704) Replaces a big match statement with a call to `unicode_script`'s `Script::short_name` method which has the same big match statement. We special case `Script::Unknown` because the `short_name` method returns empty string for that variant, but harfbuzz represents it with `Zzzz`. EDIT: `Zzzz` seems to be in the spec so I've sent a PR to `unicode_script` to use it: unicode-rs/unicode-script#23 EDIT: And unicode-rs/unicode-script#24 which would allow us to remove this method entirely. Signed-off-by: Nico Burns <[email protected]>
…t for harfbuzz (servo#38704) Replaces a big match statement with a call to `unicode_script`'s `Script::short_name` method which has the same big match statement. We special case `Script::Unknown` because the `short_name` method returns empty string for that variant, but harfbuzz represents it with `Zzzz`. EDIT: `Zzzz` seems to be in the spec so I've sent a PR to `unicode_script` to use it: unicode-rs/unicode-script#23 EDIT: And unicode-rs/unicode-script#24 which would allow us to remove this method entirely. Signed-off-by: Nico Burns <[email protected]>
The
short_name
is always 4 ascii bytes, so it's convenient to be able to access it as au32
.