-
Notifications
You must be signed in to change notification settings - Fork 316
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
Docstring improvement: free::zip
#633
Conversation
src/free.rs
Outdated
@@ -105,15 +105,19 @@ pub fn rev<I>(iterable: I) -> iter::Rev<I::IntoIter> | |||
iterable.into_iter().rev() | |||
} | |||
|
|||
/// Iterate `i` and `j` in lock step. | |||
/// `zip()` returns a new array where each element is a tuple consisting |
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.
fix: This returns an iterator, not an array, so I think the text needs to be updated.
Also, remember that the first paragraph shows in https://docs.rs/itertools/latest/itertools/index.html#functions, so it's important to have a short description of it first. A more detailed explanation of what it does it better as a separate paragraph.
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.
I went ahead and fixed the error and also made the first sentence short.
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.
Added fixes @scottmcm suggested.
src/free.rs
Outdated
@@ -105,15 +105,19 @@ pub fn rev<I>(iterable: I) -> iter::Rev<I::IntoIter> | |||
iterable.into_iter().rev() | |||
} | |||
|
|||
/// Iterate `i` and `j` in lock step. | |||
/// `zip()` returns a new array where each element is a tuple consisting |
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.
I went ahead and fixed the error and also made the first sentence short.
The free::zip function had a short explanation. I went ahead and fleshed it out a bit. I also placed the code example under the `## Example` subheading. Aslo, fixed errors in PR rust-itertools#633
f4213f5
to
9f37cb1
Compare
zip
I'm going to inline the variables so that it's easier to understand. |
9f37cb1
to
47f468d
Compare
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.
Hi there, thanks for this. I suggest keeping things simple, and rely on the redirection to std
.
Added example and link to std::iter::zip
5d35c25
to
4276476
Compare
Thank you. bors r+ |
Build succeeded: |
The
free::zip
function had a short explanation. I went ahead and fleshed it out a bit.I also placed the code example under the
## Example
subheading.