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

Refactor #11

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Refactor #11

wants to merge 4 commits into from

Conversation

Larmbs
Copy link

@Larmbs Larmbs commented Jun 14, 2024

No description provided.

@@ -12,4 +12,4 @@ version = "0.1.1"

[dependencies]
chrono = { workspace = true }
once_cell = "1.19.0"
lazy_static = "1.4.0"
Copy link
Member

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)
Copy link
Member

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
Copy link
Member

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

Copy link
Member

@assapir assapir left a 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()🫠

Copy link
Author

@Larmbs Larmbs left a 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.

@Larmbs
Copy link
Author

Larmbs commented Jun 14, 2024

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()🫠

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.

@Larmbs
Copy link
Author

Larmbs commented Jun 14, 2024

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.
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.

2 participants