Open
Conversation
vyorkin
commented
Jul 28, 2025
| pub(crate) fn new(reader: R) -> Lines<R> | ||
| where | ||
| R: AsyncBufRead + Unpin + Sized, | ||
| R: AsyncBufRead + Sized, |
Author
There was a problem hiding this comment.
I removed Unpin but I'm not sure if this is correct.
Does reader: R actually need to implement Unpin...?
My understanding of pinning is quite limited :(
vyorkin
commented
Jul 28, 2025
| this.buf.pop(); | ||
| } | ||
| Poll::Ready(Some(Ok(mem::replace(this.buf, String::new())))) | ||
| Poll::Ready(Some(Ok(std::mem::take(this.buf)))) |
Author
There was a problem hiding this comment.
std::mem::take is just more concise and idiomatic (clippy suggested this change):
since String implements Default as an empty string, mem::take should replace this.buf with an empty string
vyorkin
commented
Jul 28, 2025
Comment on lines
-32
to
-34
| /// Was the last character of the previous line a \r? | ||
| /// Bytes that were fed to the decoder but do not yet form a message. | ||
| buffer: Vec<u8>, |
Author
There was a problem hiding this comment.
I didn't find any usage of this buffer field
Author
|
Hi @yoshuawuyts, sorry to bother you — just a quick reminder about PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi Yoshua,
Thank you for maintaining this crate!
In this PR I tried to carefully upgrade the dependencies to their latest versions and fix some clippy warnings.
Here is the list of updated crates:
I also had to update a few tests to use
Box::pinforencoder, like this:Here is what I mean:
Hopefully this is the right approach...
I split the changes into multiple commits to make the review easier.
Please let me know if anything needs improvement — I’m happy to help.