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

Example does not match "IntoIter::new" #733

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

michael88888888
Copy link

I think the below should be modified

from

/// /// use bytes::Bytes; /// /// let buf = Bytes::from_static(b"abc"); /// let mut iter = buf.into_iter(); /// /// assert_eq!(iter.next(), Some(b'a')); /// assert_eq!(iter.next(), Some(b'b')); /// assert_eq!(iter.next(), Some(b'c')); /// assert_eq!(iter.next(), None); ///

to

/// /// use bytes::{buf::IntoIter, Bytes}; /// /// let buf = Bytes::from_static(b"abc"); /// let mut iter = IntoIter::new(buf); /// /// assert_eq!(iter.next(), Some(b'a')); /// assert_eq!(iter.next(), Some(b'b')); /// assert_eq!(iter.next(), Some(b'c')); /// assert_eq!(iter.next(), None); ///

Copy link
Author

@michael88888888 michael88888888 left a comment

Choose a reason for hiding this comment

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

Thanks. It could make sense to add a paragraph like this.

    /// Using this constructor is equivalent to calling `into_iter`.
    ///
    /// # Examples

Sure, I think that would be fine. Thanks.

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.

3 participants