-
Notifications
You must be signed in to change notification settings - Fork 508
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
Add nanoseconds without dots #251
Conversation
Looking great! Regarding your questions:
|
I took a little time to look at it, and modifying the beginning of for item in items {
println!("s: {:?} item: {:?} parsed: {:?} ", s, item, parsed);
match item { results in this error:
which strongly suggests that |
Good catch. It was an issue with using the |
src/format/parse.rs
Outdated
check!("42195", [fix!(Nanosecond9NoDot)]; nanosecond: 421_950_000); | ||
check!("421950803", [fix!(Nanosecond9NoDot)]; nanosecond: 421_950_803); | ||
check!("421950803547", [fix!(Nanosecond9NoDot)]; nanosecond: 421_950_803); | ||
// check!("421950803547", [fix!(Nanosecond9NoDot), num!(Second)]; nanosecond: 421_950_803, second: 54); // don't skip digits that come after the 9 |
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.
did you want to uncomment this?
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, I'm fixing the test. I'll add another commit to the PR tomorrow
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.
Still looking good, there are two new changes:
- You're going to need to either rebase or merge in master, and you'll probably get conflicts in the changelog
- Could you move your new variants into the
InternalInternal
struct, the equivalent of this commit for your changes? It didn't exist when you started work, but I think that, sadly, it's necessary for strict semver compat.
Yeah, I'll make those changes tomorrow. Would you prefer me to squash all the commits into one or leave them as they are? |
The commits are nicely separated as is, no need to squash. I would also appreciate the refactoring to use Speaking of it, though, if you are going to be editing your test commit and you use git from the command line I have a very new project that I'm looking for beta testers/bug reporters/contributors on that is supposed to make editing old commits a bit nicer. |
Error if it's too long or short, and don't take any more digits
I'm not sure I understand that. Is the idea to make it so this feature can't be accessed by the user? What is the semver issue (it's a non-breaking change)? |
Adding new variants to a public enum is a major breaking change. The idea isn't to prevent usage of the feature, it's to require that the only usage of the feature is through the The hack used by the ecosystem to mark enums as open is to have a For most libraries I think that just having bad docs would mean that you can just fix them and improve life, but chrono is one of the most depended-on crates in the ecosystem and so if any crate is going to have someone doing crazy things against massive enums then chrono might be it. |
specifically, the only things that you should need to change should be to move your variants to the |
Gotcha. Thanks for the explanation. (Never mind, think I got it) |
To avoid adding new variants to the public enum (see chronotope#251 (comment))
Made the change. Ready for re-review |
LGTM, I'm going to do one more review pass this evening, I don't recall any other possible concerns so hopefully I'll get this published tonight. |
Sounds good. Thanks for the help! |
There is some specific behavior around writing out truncated nanos that we want to be sure to preserve.
Resolves #250