-
Notifications
You must be signed in to change notification settings - Fork 185
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
Remove BCP-47 APIs from AnyCalendarKind
, use CalendarAlgorithm
instead
#6228
Conversation
/// Construct from a BCP-47 byte string | ||
/// | ||
/// Returns `None` if the calendar is unknown. | ||
pub fn get_for_bcp47_bytes(x: &[u8]) -> Option<Self> { |
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.
question: is there a valid alternative to use besides get_for_bcp47_bytes
and as_bcp47_string
?
temporal_rs
uses these methods downstream, but maybe there's a better approach to use
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.
Yes, the API on CalendarAlgorithm
. That actually complies with BCP-47, unlike this which fails on islamic-rgsa
, and accepts japanext
.
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.
Perfect! Thanks for the confirmation 😄
At a glance, it looks like it is more aligned, which is nice. Is there any handling for islamicc
though? Although, that may be changing with the hijri rename
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.
@zbraniecki do preference support aliases?
Japanese => CalendarAlgorithm::Japanese, | ||
JapaneseExtended => CalendarAlgorithm::Japanese, |
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.
Thought: This is lossy.
I guess we can fix this when https://unicode-org.atlassian.net/browse/CLDR-15669 gets implemented.
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.
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.
Yeah, we should fix #4889.
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.
Nice, I guess AnyCalendarKind was somewhat of a proto-CalendarAlgorithm preferences but we don't need that complexity anymore
Japanese => CalendarAlgorithm::Japanese, | ||
JapaneseExtended => CalendarAlgorithm::Japanese, |
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.
Yeah, we should fix #4889.
#6227