-
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
Caching for observational islamic calendar #4770
Conversation
|
||
/// Marker type for Saudi islamic calendar, for use with [`IslamicBasedMarker`] | ||
#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq)] | ||
pub struct SaudiIslamicMarker; |
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: why Saudi instead of UmmAlQura?
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.
That's what the book calls this code; I'm using book names here.
@@ -17,22 +17,129 @@ const CAIRO: Location = Location { | |||
zone: (1_f64 / 12_f64), | |||
}; | |||
|
|||
/// Common abstraction over islamic-style calendars | |||
pub trait IslamicBasedMarker { |
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 crate isn't really public-facing so API doesn't matter too much, but if this were ICU4X I would probably make the trait contain only the three items that are reasonably implementable, and the things that are not implementable/overridable should go into another struct that has the trait as a generic.
pub struct IslamicCacheCalculator<M> { ... }
impl<M: IslamicBasedMarker> IslamicBasedMarker<M> { ... }
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.
I intend for some of these to be overridden in the long run for performance (it's just annoying to do now)
Co-authored-by: Shane F. Carr <[email protected]>
Co-authored-by: Shane F. Carr <[email protected]>
Progress on #3933
Doing the other three should be easy after this.