Add documentation on str::starts_with
by vcfxb · Pull Request #120764 · rust-lang/rust (original) (raw)
I don't think this wording (with "footgun", "some users", "currently", etc.) is very useful.
How about instead just adding a bit more detail to the paragraph above? Maybe something in this direction?
- /// The [pattern] can be a
&str
, [char
], a slice of [char
]s, or a - /// function or closure that determines if a character matches.
- /// The [pattern] can be a
&str
to check for a prefix, - /// or a [
char
], slice of [char
]s, or function or closure - /// to check the first character for a match.