Skip to content

doc: Alias skip_while with drop_while #72491

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 2 commits into from

Conversation

tesuji
Copy link
Contributor

@tesuji tesuji commented May 23, 2020

Many other programming languages use dropwhile instead of skip_while like Rust.

For example:

Language Name
Python dropwhile
Ruby drop_while
Haskell dropWhile
Java? dropWhile

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 23, 2020
@tesuji
Copy link
Contributor Author

tesuji commented May 25, 2020

r? @steveklabnik

@steveklabnik
Copy link
Member

r? @rust-lang/libs

Sorry, this is not my area of specialty! Someone from the libs team should review this.

Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

I don't think doc(alias) works with trait methods. Or it didn't seem to do anything when I built this locally. Can you share a screenshot?

@dtolnay
Copy link
Member

dtolnay commented May 25, 2020

r? @dtolnay

@tesuji
Copy link
Contributor Author

tesuji commented May 26, 2020

I don't think doc(alias) works with trait methods

Sorry, I overlooked that. cc #50146

Now I use inline doc. But it wouldn't show up when searching.

Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

I think I would prefer not to have this kind of content in the standard library docs. Once doc(alias) works on trait methods let's go ahead and use that as originally intended.

@dtolnay dtolnay closed this May 26, 2020
@tesuji
Copy link
Contributor Author

tesuji commented May 27, 2020

There is pre-existing one for Option::and_then.
My motivation is to save people come from other langauges from
searching Google and other places for "drop_while" function.

I could add a FIXME/TODO to use "doc_alias" feature when it is complete.
But yeah, you may have valid concerns about downside of this.

@tesuji tesuji deleted the alias-drop-while branch May 27, 2020 02:10
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants