-
Notifications
You must be signed in to change notification settings - Fork 37
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
Fixed incorrect behaviour on str impl. #96
base: master
Are you sure you want to change the base?
Conversation
This PR replaces the |
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.
while this isn't a breaking change, it's a pretty big semantic change to str parsing that i/we need to understand in detail; in particular, i need to understand if this somehow breaks goblin (which uses scroll's str parsing) somehow. otherwise i think it looks ok, though i haven't really reviewed in depth yet.
regardless the empty strs that were coming up in the scroll test in your fixed size array pr that prompted this was very counterintuitive (and as we see, bytes using 0 delimiter parsing has the expected size of 2 (instead of 3))
On the note of goblin, I created a RegEx for matching at least the calls to read, with mention str explicitly: |
18d11bc
to
d369188
Compare
somewhat unrelated, i want to release a new scroll version, but i'm on the fence whether i should release as 0.12 or 0.11.1, since it updates MSRV and (imho) this should be considered a breaking change, as it can unexpectedly break peoples builds. However, 1.63 rustc is from August 11th, 2022, so 1.5 years ago, which is quite long. |
Ok as i feared, trying out this patch in goblin causes several failures:
will need to do more of investigation to see what's going on; it's possible the behavior of scroll here is directly because of goblin's use (they were developed in tandem originally), but I don't know. |
I've decided to release scroll 0.12 without this patch; we can investigate the root causes to this later, but for now, happy new year! |
Regarding this, we should maybe reconsider the no deps policy, for scroll, at least in the case of memchar. We could make this an optional feature, it probably won't hurt the library, since memchr is used internally in |
friendly ping about the status of this? I'd like to see a proper fix here, but avoiding breakage, don't know if that has been resolved. re adding deps, there would have to be really compelling reason to add any new deps to scroll, backed with a good amount of empirical evidence justifying its inclusion. even then, it would be hard decision. over the years, scroll + goblin's strict dep policy has served us well, and i'm quite happy with the situation, but again, always open to good argumentation to potentially change my mind on this position 🤷 |
I don't think that adding |
* Added SizeWith impl for fixed array.
The default
TryFromCtx
impl for&str
succeeds, even if a null byte is missing. This caused the unexpected behavior in #95. I'm unsure, if this is intended behavior, but while developing the previously referenced PR it was certainly unexpected.