-
Notifications
You must be signed in to change notification settings - Fork 4
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
Idiomatic fixes 2 #5
Conversation
the bounds can be satisfied without both cloned() and copied(). of the two, copied is the more cheaper abstraction so leave only that one.
`or_insert_with` will only call encapsulating function when it is necessary
panic! prints e into stderr, just like stderr. one difference to the original code would be that it exits with error code 101 if this behavior is not wanted, there's another way to maintain current behavior with idiomatic code.
unless this function is necessary again we can simply replace it
!!! this changes `intermediary_mean_mess_ratio_calcratio` but this seems more correct?
this is exactly equal to self % rhs
I'm not even sure if this is or the previous is more correct
there are several other ways to do this idiomatically. we could also use iterators.
Exit code 1 should be there as I would prefer to have it compatible with Python CLI tool. |
what do you mean? |
What I meant was that the intended range was unclear to me. |
Yes panic! returns It less concise though. |
I guess we can leave panic! here. No problem. About +1 and 510 - it looks okay. |
So which do you prefer?
or
? |
Second one, pls. |
Reverted! |
This reverts commit 13abf49.
Is it the final version of PR? Can I check & approve it? |
Yes. I think other changes can wait until after this one has been considered and merged. |
c918f37 and 0b3ff3b need special attention.
Since the length + 1 was not necessary, i removed it and changed some code (length - 1) downstream.
This does affect the match range, and so i changed the range to match the original behavior, but it looks strange now
(0~510 instead of 512?)
other than that it is mostly sideeffectless changes, except 7d65129 which changed exit behavior.
If the original exit code 1 is strictly necessary there are other ways to do recover the behavior as well.