Skip to content

Add missing links to str docs #30342

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

Merged
merged 1 commit into from
Dec 13, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 42 additions & 14 deletions src/libcore/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,9 @@ Section: Iterators

/// Iterator for the char (representing *Unicode Scalar Values*) of a string
///
/// Created with the method `.chars()`.
/// Created with the method [`chars()`].
///
/// [`chars()`]: ../primitive.str.html#method.chars
#[derive(Clone)]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct Chars<'a> {
Expand Down Expand Up @@ -499,7 +501,9 @@ impl<'a> CharIndices<'a> {
/// External iterator for a string's bytes.
/// Use with the `std::iter` module.
///
/// Created with the method `.bytes()`.
/// Created with the method [`bytes()`].
///
/// [`bytes()`]: ../primitive.str.html#method.bytes
#[stable(feature = "rust1", since = "1.0.0")]
#[derive(Clone)]
pub struct Bytes<'a>(Cloned<slice::Iter<'a, u8>>);
Expand Down Expand Up @@ -782,10 +786,14 @@ impl<'a, P: Pattern<'a>> SplitInternal<'a, P> {

generate_pattern_iterators! {
forward:
/// Created with the method `.split()`.
/// Created with the method [`split()`].
///
/// [`split()`]: ../primitive.str.html#method.split
struct Split;
reverse:
/// Created with the method `.rsplit()`.
/// Created with the method [`rsplit()`].
///
/// [`rsplit()`]: ../primitive.str.html#method.rsplit
struct RSplit;
stability:
#[stable(feature = "rust1", since = "1.0.0")]
Expand All @@ -796,10 +804,14 @@ generate_pattern_iterators! {

generate_pattern_iterators! {
forward:
/// Created with the method `.split_terminator()`.
/// Created with the method [`split_terminator()`].
///
/// [`split_terminator()`]: ../primitive.str.html#method.split_terminator
struct SplitTerminator;
reverse:
/// Created with the method `.rsplit_terminator()`.
/// Created with the method [`rsplit_terminator()`].
///
/// [`rsplit_terminator()`]: ../primitive.str.html#method.rsplit_terminator
struct RSplitTerminator;
stability:
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -842,10 +854,14 @@ impl<'a, P: Pattern<'a>> SplitNInternal<'a, P> {

generate_pattern_iterators! {
forward:
/// Created with the method `.splitn()`.
/// Created with the method [`splitn()`].
///
/// [`splitn()`]: ../primitive.str.html#method.splitn
struct SplitN;
reverse:
/// Created with the method `.rsplitn()`.
/// Created with the method [`rsplitn()`].
///
/// [`rsplitn()`]: ../primitive.str.html#method.rsplitn
struct RSplitN;
stability:
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -880,10 +896,14 @@ impl<'a, P: Pattern<'a>> MatchIndicesInternal<'a, P> {

generate_pattern_iterators! {
forward:
/// Created with the method `.match_indices()`.
/// Created with the method [`match_indices()`].
///
/// [`match_indices()`]: ../primitive.str.html#method.match_indices
struct MatchIndices;
reverse:
/// Created with the method `.rmatch_indices()`.
/// Created with the method [`rmatch_indices()`].
///
/// [`rmatch_indices()`]: ../primitive.str.html#method.rmatch_indices
struct RMatchIndices;
stability:
#[stable(feature = "str_match_indices", since = "1.5.0")]
Expand Down Expand Up @@ -920,10 +940,14 @@ impl<'a, P: Pattern<'a>> MatchesInternal<'a, P> {

generate_pattern_iterators! {
forward:
/// Created with the method `.matches()`.
/// Created with the method [`matches()`].
///
/// [`matches()`]: ../primitive.str.html#method.matches
struct Matches;
reverse:
/// Created with the method `.rmatches()`.
/// Created with the method [`rmatches()`].
///
/// [`rmatches()`]: ../primitive.str.html#method.rmatches
struct RMatches;
stability:
#[stable(feature = "str_matches", since = "1.2.0")]
Expand All @@ -932,7 +956,9 @@ generate_pattern_iterators! {
delegate double ended;
}

/// Created with the method `.lines()`.
/// Created with the method [`lines()`].
///
/// [`lines()`]: ../primitive.str.html#method.lines
#[stable(feature = "rust1", since = "1.0.0")]
#[derive(Clone)]
pub struct Lines<'a>(Map<SplitTerminator<'a, char>, LinesAnyMap>);
Expand Down Expand Up @@ -960,7 +986,9 @@ impl<'a> DoubleEndedIterator for Lines<'a> {
}
}

/// Created with the method `.lines_any()`.
/// Created with the method [`lines_any()`].
///
/// [`lines_any()`]: ../primitive.str.html#method.lines_any
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(since = "1.4.0", reason = "use lines()/Lines instead now")]
#[derive(Clone)]
Expand Down