rust-lang/rust — pull request #20058 by Kimundi (2014-12-20 02:37:49+00:00)
Title: WIP Partially stabilize `StrExt` for pattern-using methods

This stabilizes the methods on `&str` working with patterns in a way that is forwards-compatible with a generic string pattern matching API:
- Methods that are using the primary name for their operation are marked as `#[stable]`, as they can be upgraded to a full `Pattern` API later without existing code breaking. Example: `contains(&str)`
- Methods that are using a more specific name in order to not clash with the primary one are marked as `#[unstable]`, as they will likely be removed once their functionality is merged into the primary one. Example: `contains_char(C)`
- The method docs got changed to consistently refer to the pattern types as a pattern.
- Methods whose names do not match in the context of the more generic API got renamed. Example: `trim_chars -> trim_matches`

Additionally, all methods returning iterators got changed to return unique new types with changed names in accordance with the new naming guidelines.

Lastly, the second commit changes most `StrExt` methods over to be default methods, in order to reduce the overall code needed for each method, and to make future refactorings easier.