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

nlprule-build: sure cursor is not seek'd all to the end #39

Merged
merged 3 commits into from
Feb 20, 2021

Conversation

drahnr
Copy link
Contributor

@drahnr drahnr commented Feb 20, 2021

Before the cursor was passed twice as &mut Cursor which lead to the second usage failing, since it was already read to the end.

Replaced by &mut v.as_slice() which is cheaper and does not have to be seek'd back to start.

Since transform data is short lived, the input data of TransformDataFn must be bound to 'r, which is commonly equiv 'w, but that restriction should be left to the user.

Since transform data is short lived, the input data, input can be bound by 'r
as well.
@drahnr
Copy link
Contributor Author

drahnr commented Feb 20, 2021

@bminixhofer I would like for this to be included asap, it's fallout of #35
Tests were expanded accordingly to verify the content is parseable and this works in the latest iteration of cargo-spellcheck

Copy link
Owner

@bminixhofer bminixhofer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like using a previous release to test the transform and postprocess! This looks good to me.

@bminixhofer bminixhofer merged commit 28c9358 into bminixhofer:main Feb 20, 2021
@drahnr drahnr deleted the bar branch February 20, 2021 22:22
@drahnr
Copy link
Contributor Author

drahnr commented Feb 20, 2021

Thanks for being so on top of this, much appreciated!

drahnr added a commit to drahnr/nlprule that referenced this pull request Apr 7, 2021
* make sure cursor is not at the end already

Since transform data is short lived, the input data, input can be bound by 'r
as well.

* add another missing seek back to 0

* assure test data is decoded successfully
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