about summary refs log tree commit diff
path: root/src/test/rustdoc-ui/coverage/json.rs
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-04-20 18:07:12 +0200
committerGitHub <noreply@github.com>2020-04-20 18:07:12 +0200
commitb921587c91cffe5205b472d562432d5f93374218 (patch)
treedfabe458b912b67789905471180c6bd45171efa4 /src/test/rustdoc-ui/coverage/json.rs
parent7561714aa1e4b3478f62357b6826c3587aedfeb5 (diff)
parentca61fd56360f7fb289df11fd51e7392b87100cfd (diff)
downloadrust-b921587c91cffe5205b472d562432d5f93374218.tar.gz
rust-b921587c91cffe5205b472d562432d5f93374218.zip
Rollup merge of #71334 - ehuss:pattern-docs, r=kennytm
Update pattern docs.

A few changes to help clarify string pattern usage:

* Add some examples and stability information in the `pattern` module.
* Fixes the links at https://doc.rust-lang.org/std/str/pattern/ because intra-doc-links don't work with re-exported modules (#65983 I think?).
* Consistently use the same phrasing for `str` methods taking a pattern.
    * Also mention that array of `char` is also accepted.

When `Pattern` is stabilized, the phrasing in the `str` methods can be updated to be more general to reflect the exact behavior. I'm reluctant to do this now because the stability story for `Pattern` is uncertain. It may perhaps look something like:

> The pattern can be any type that implements the [`Pattern`] trait. Notable examples are `&str`, [`char`], arrays of [`char`], or functions or closures that determines if a character matches. Additional libraries might provide more complex patterns like regular expressions.

This is complicated because methods like `trim_matches` have bounds, which for example don't support `str`, so those methods may need more elaboration.
Diffstat (limited to 'src/test/rustdoc-ui/coverage/json.rs')
0 files changed, 0 insertions, 0 deletions