-
Notifications
You must be signed in to change notification settings - Fork 1
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
Refactor #11
base: main
Are you sure you want to change the base?
Refactor #11
Conversation
@@ -12,4 +12,4 @@ version = "0.1.1" | |||
|
|||
[dependencies] | |||
chrono = { workspace = true } | |||
once_cell = "1.19.0" | |||
lazy_static = "1.4.0" |
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.
Not sure what the benefits are of using lazy_static vs. once_cell::lazy?
} | ||
|
||
#[inline] | ||
fn reminder(x: i32, y: i32) -> i32 { | ||
x - y * (x as f32 / y as f32).floor() as i32 | ||
x.rem_euclid(y) |
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.
👍🏻
@@ -199,22 +203,16 @@ impl HebrewMonth { | |||
/// let month = HebrewMonth::try_from_ym(HebrewMonth::AdarI as u8, 5763).unwrap(); | |||
/// assert_eq!(month, HebrewMonth::AdarI); | |||
pub fn try_from_ym(month: u8, year: u32) -> Result<HebrewMonth, HebrewDateErrors> { | |||
// ??? Why not use assert, should be consistent |
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.
Good point. Maybe we should assert on it
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.
Overall LGTM, Thanks!
Because a lot of reserve duty I didn't had any time to continue working on it, so super thanks. I wonder why it didn't worked for me without the floor()
🫠
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.
Thanks for reviewing and implementing my changes.
I hope all is well, yeah I'm not sure why you put floor in some places and not others. But integer division already accounts for that so it's a simple optimization. |
I was actually considering making my own Hebrew date calculator, but after seeing yours I thought it was best to help out. |
not to happy about this, but eventually better fitting result types will be made.
No description provided.