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

peek_read should be &mut self, not &self #555

Closed
AlexApps99 opened this issue Jun 20, 2022 · 1 comment · Fixed by #572
Closed

peek_read should be &mut self, not &self #555

AlexApps99 opened this issue Jun 20, 2022 · 1 comment · Fixed by #572

Comments

@AlexApps99
Copy link

I'm currently implementing Reader for a newtype over VecDeque.

To implement peek_read, I need to make the VecDeque contiguous with make_contiguous, which mutates in order to make the data a single contiguous slice.

I don't see any reason why peek_read should require being immutable, as every context I have seen it used in is followed by consume.

Would it be OK to change this in a PR?

@VictorKoenders
Copy link
Contributor

👍 I see nothing wrong with peek_read taking &mut self

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants