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

std::str::pattern::Pattern documentation #45507

Closed
jethrogb opened this issue Oct 24, 2017 · 3 comments · Fixed by #72932
Closed

std::str::pattern::Pattern documentation #45507

jethrogb opened this issue Oct 24, 2017 · 3 comments · Fixed by #72932
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. P-medium Medium priority T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@jethrogb
Copy link
Contributor

Correct me if I'm wrong, but I don't think it's possible to find out from the currently available online documentation if the following code returns true or false:

"ab".contains(&['b', 'a'][..])

Is searching for a slice of chars the same as searching for the string of the contatenation? Or is this a set match?

There is no information on this in the following places:

@steveklabnik steveklabnik added A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools P-medium Medium priority labels Oct 30, 2017
@Freyskeyd
Copy link
Contributor

If no one is working on it I would be happy to update this.

@frewsxcv
Copy link
Member

@Freyskeyd did you make any progress on this or is it alright for others to work on it?

@XAMPPRocky XAMPPRocky added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Feb 12, 2018
@steveklabnik steveklabnik added the E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. label May 29, 2018
@Emerentius
Copy link
Contributor

I think it'd be best if the explanation is put on the page of std::str::pattern::Pattern (and not on the respective impls) so that it is easy to lookup in a central position.
A small table and some examples should do such as the ones I've written over here.

I don't know how to do a sanity check compile. Apparently I need to compile all of rustc(?!) to get the docs, which is not feasible for me. If anybody would like to send the PR, they can use my branch as a base. Maybe improve the wording as well.

@jonas-schievink jonas-schievink added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Mar 6, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Jun 13, 2020
…iour, r=hanna-kruppe

Clarify the behaviour of Pattern when used with methods like str::contains

Fixes rust-lang#45507.

I used the previous work by @Emerentius (thanks !), added a paragraph and checked the links (they work for me but I'm not against someone else checking them too).
RalfJung added a commit to RalfJung/rust that referenced this issue Jun 13, 2020
…iour, r=hanna-kruppe

Clarify the behaviour of Pattern when used with methods like str::contains

Fixes rust-lang#45507.

I used the previous work by @Emerentius (thanks !), added a paragraph and checked the links (they work for me but I'm not against someone else checking them too).
RalfJung added a commit to RalfJung/rust that referenced this issue Jun 13, 2020
…iour, r=hanna-kruppe

Clarify the behaviour of Pattern when used with methods like str::contains

Fixes rust-lang#45507.

I used the previous work by @Emerentius (thanks !), added a paragraph and checked the links (they work for me but I'm not against someone else checking them too).
RalfJung added a commit to RalfJung/rust that referenced this issue Jun 13, 2020
…iour, r=hanna-kruppe

Clarify the behaviour of Pattern when used with methods like str::contains

Fixes rust-lang#45507.

I used the previous work by @Emerentius (thanks !), added a paragraph and checked the links (they work for me but I'm not against someone else checking them too).
RalfJung added a commit to RalfJung/rust that referenced this issue Jun 13, 2020
…iour, r=hanna-kruppe

Clarify the behaviour of Pattern when used with methods like str::contains

Fixes rust-lang#45507.

I used the previous work by @Emerentius (thanks !), added a paragraph and checked the links (they work for me but I'm not against someone else checking them too).
RalfJung added a commit to RalfJung/rust that referenced this issue Jun 13, 2020
…iour, r=hanna-kruppe

Clarify the behaviour of Pattern when used with methods like str::contains

Fixes rust-lang#45507.

I used the previous work by @Emerentius (thanks !), added a paragraph and checked the links (they work for me but I'm not against someone else checking them too).
@bors bors closed this as completed in 2cc2672 Jun 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. P-medium Medium priority T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants