Skip to content

Commit ba70bd8

Browse files
committed
Removed all intra-doc-links from the needle docs.
They are not resolving (perhaps due to re-export) and causing CI failure.
1 parent a029d3c commit ba70bd8

File tree

6 files changed

+96
-91
lines changed

6 files changed

+96
-91
lines changed

src/libcore/needle/ext.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,10 @@ where
315315

316316
generate_pattern_iterators! {
317317
forward:
318-
/// Created with the function [`matches`].
318+
/// Created with the function [`matches`](fn.matches.html).
319319
struct Matches;
320320
reverse:
321-
/// Created with the function [`rmatches`].
321+
/// Created with the function [`rmatches`](fn.rmatches.html).
322322
struct RMatches;
323323
stability:
324324
internal:
@@ -412,10 +412,10 @@ where
412412

413413
generate_pattern_iterators! {
414414
forward:
415-
/// Created with the function [`match_indices`].
415+
/// Created with the function [`match_indices`](fn.match_indices.html).
416416
struct MatchIndices;
417417
reverse:
418-
/// Created with the function [`rmatch_indices`].
418+
/// Created with the function [`rmatch_indices`](fn.rmatch_indices.html).
419419
struct RMatchIndices;
420420
stability:
421421
internal:
@@ -530,10 +530,10 @@ where
530530

531531
generate_pattern_iterators! {
532532
forward:
533-
/// Created with the function [`match_ranges`].
533+
/// Created with the function [`match_ranges`](fn.match_ranges.html).
534534
struct MatchRanges;
535535
reverse:
536-
/// Created with the function [`rmatch_ranges`].
536+
/// Created with the function [`rmatch_ranges`](fn.rmatch_ranges.html).
537537
struct RMatchRanges;
538538
stability:
539539
internal:
@@ -685,10 +685,10 @@ where
685685

686686
generate_pattern_iterators! {
687687
forward:
688-
/// Created with the function [`split`].
688+
/// Created with the function [`split`](fn.split.html).
689689
struct Split;
690690
reverse:
691-
/// Created with the function [`rsplit`].
691+
/// Created with the function [`rsplit`](fn.rsplit.html).
692692
struct RSplit;
693693
stability:
694694
internal:
@@ -698,10 +698,10 @@ generate_pattern_iterators! {
698698

699699
generate_pattern_iterators! {
700700
forward:
701-
/// Created with the function [`split_terminator`].
701+
/// Created with the function [`split_terminator`](fn.split_terminator.html).
702702
struct SplitTerminator;
703703
reverse:
704-
/// Created with the function [`rsplit_terminator`].
704+
/// Created with the function [`rsplit_terminator`](fn.rsplit_terminator.html).
705705
struct RSplitTerminator;
706706
stability:
707707
internal:
@@ -743,7 +743,7 @@ where
743743

744744
/// An iterator over slices of the haystack, separated by parts matched by the needle.
745745
///
746-
/// Equivalent to [`split`], except that the trailing slice is skipped if empty.
746+
/// Equivalent to [`split`](fn.split.html), except that the trailing slice is skipped if empty.
747747
///
748748
/// This method can be used for haystack data that is *terminated*,
749749
/// rather than *separated* by a needle.
@@ -764,7 +764,7 @@ where
764764
/// An iterator over slices of the haystack, separated by parts matched by the needle
765765
/// and yielded in reverse order.
766766
///
767-
/// Equivalent to [`rsplit`], except that the trailing slice is skipped if empty.
767+
/// Equivalent to [`rsplit`](fn.rsplit.html), except that the trailing slice is skipped if empty.
768768
///
769769
/// This method can be used for haystack data that is *terminated*,
770770
/// rather than *separated* by a needle.
@@ -868,10 +868,10 @@ where
868868

869869
generate_pattern_iterators! {
870870
forward:
871-
/// Created with the function [`splitn`].
871+
/// Created with the function [`splitn`](fn.splitn.html).
872872
struct SplitN;
873873
reverse:
874-
/// Created with the function [`rsplitn`].
874+
/// Created with the function [`rsplitn`](fn.rsplitn.html).
875875
struct RSplitN;
876876
stability:
877877
internal:

src/libcore/needle/haystack.rs

+12-10
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ use ops::{Deref, Range};
33

44
/// Borrowed `Haystack`.
55
///
6-
/// Every [`Haystack`] type can be borrowed as references to `Hay` types. This
7-
/// allows multiple similar types to share the same implementation (e.g. the
8-
/// haystacks `&[T]` and `&mut [T]` both have the same corresponding hay type
9-
/// `[T]`).
6+
/// Every [`Haystack`](trait.Haystack.html) type can be borrowed as references
7+
/// to `Hay` types. This allows multiple similar types to share the same
8+
/// implementation (e.g. the haystacks `&[T]` and `&mut [T]` both have the same
9+
/// corresponding hay type `[T]`).
1010
///
1111
/// In the other words, a `Haystack` is a generalized reference to `Hay`.
1212
/// `Hay`s are typically implemented on unsized slice types like `str` and `[T]`.
@@ -141,9 +141,9 @@ pub unsafe trait Hay {
141141
///
142142
/// A `Haystack` is implemented for reference and collection types such as
143143
/// `&str`, `&mut [T]` and `Vec<T>`. Every haystack can be borrowed as an
144-
/// underlying representation called a [`Hay`]. Multiple haystacks may share the
145-
/// same hay type, and thus share the same implementation of string search
146-
/// algorithms.
144+
/// underlying representation called a [`Hay`](trait.Hay.html).
145+
/// Multiple haystacks may share the same hay type, and thus share the same
146+
/// implementation of string search algorithms.
147147
///
148148
/// In the other words, a `Haystack` is a generalized reference to `Hay`.
149149
///
@@ -212,8 +212,9 @@ pub unsafe trait Haystack: Deref + Sized where Self::Target: Hay {
212212
/// (original.start + parent.start)..(original.start + parent.end)
213213
/// ```
214214
///
215-
/// If this haystack is a [`SharedHaystack`], this method should never be
216-
/// called, and calling it would cause an unreachable panic.
215+
/// If this haystack is a [`SharedHaystack`](trait.SharedHaystack.html),
216+
/// this method should never be called, and calling it would cause an
217+
/// unreachable panic.
217218
///
218219
/// # Safety
219220
///
@@ -257,7 +258,8 @@ pub unsafe trait Haystack: Deref + Sized where Self::Target: Hay {
257258
) -> Range<<Self::Target as Hay>::Index>;
258259
}
259260

260-
/// A [`Haystack`] which can be shared and cheaply cloned (e.g. `&H`, `Rc<H>`).
261+
/// A [`Haystack`](trait.Haystack.html) which can be shared and cheaply cloned
262+
/// (e.g. `&H`, `Rc<H>`).
261263
///
262264
/// If a haystack implements this marker trait, during internal operations the
263265
/// original haystack will be retained in full and cloned, rather than being

src/libcore/needle/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
//!
55
//! This module provides traits to facilitate searching [`Needle`] in a [`Haystack`].
66
//!
7+
//! [`Needle`]: trait.Needle.html
8+
//! [`Haystack`]: trait.Haystack.html
9+
//!
710
//! Haystacks
811
//! =========
912
//!

src/libcore/needle/needle.rs

+62-62
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ use super::haystack::{Haystack, Hay, Span};
22

33
use ops::Range;
44

5-
/// A searcher, for searching a [`Needle`] from a [`Hay`].
5+
/// A searcher, for searching a [`Needle`](trait.Needle.html) from a
6+
/// [`Hay`](trait.Hay.html).
67
///
78
/// This trait provides methods for searching for non-overlapping matches of a
89
/// needle starting from the front (left) of a hay.
@@ -90,23 +91,22 @@ pub unsafe trait Searcher<A: Hay + ?Sized> {
9091
///
9192
/// This method is used to support the following standard algorithms:
9293
///
93-
/// * [`matches`](std::needle::ext::matches)
94-
/// * [`contains`](std::needle::ext::contains)
95-
/// * [`match_indices`](std::needle::ext::match_indices)
96-
/// * [`find`](std::needle::ext::find)
97-
/// * [`match_ranges`](std::needle::ext::match_ranges)
98-
/// * [`find_range`](std::needle::ext::find_range)
99-
/// * [`split`](std::needle::ext::split)
100-
/// * [`split_terminator`](std::needle::ext::split_terminator)
101-
/// * [`splitn`](std::needle::ext::splitn)
102-
/// * [`replace_with`](std::needle::ext::replace_with)
103-
/// * [`replacen_with`](std::needle::ext::replacen_with)
94+
/// * [`matches`](ext/fn.matches.html)
95+
/// * [`contains`](ext/fn.contains.html)
96+
/// * [`match_indices`](ext/fn.match_indices.html)
97+
/// * [`find`](ext/fn.find.html)
98+
/// * [`match_ranges`](ext/fn.match_ranges.html)
99+
/// * [`find_range`](ext/fn.find_range.html)
100+
/// * [`split`](ext/fn.split.html)
101+
/// * [`split_terminator`](ext/fn.split_terminator.html)
102+
/// * [`splitn`](ext/fn.splitn.html)
103+
/// * [`replace_with`](ext/fn.replace_with.html)
104+
/// * [`replacen_with`](ext/fn.replacen_with.html)
104105
///
105106
/// The hay and the restricted range for searching can be recovered by
106-
/// calling `span`[`.into_parts()`](Span::into_parts). The range returned
107-
/// by this method
108-
/// should be relative to the hay and must be contained within the
109-
/// restricted range from the span.
107+
/// calling `span`[`.into_parts()`](struct.Span.html#method.into_parts).
108+
/// The range returned by this method should be relative to the hay and
109+
/// must be contained within the restricted range from the span.
110110
///
111111
/// If the needle is not found, this method should return `None`.
112112
///
@@ -146,13 +146,13 @@ pub unsafe trait Searcher<A: Hay + ?Sized> {
146146
fn search(&mut self, span: Span<&A>) -> Option<Range<A::Index>>;
147147
}
148148

149-
/// A consumer, for searching a [`Needle`] from a [`Hay`] anchored at the
150-
/// beginnning.
149+
/// A consumer, for searching a [`Needle`](trait.Needle.html) from a
150+
/// [`Hay`](trait.Hay.html) anchored at the beginnning.
151151
///
152152
/// This trait provides methods for matching a needle anchored at the beginning
153153
/// of a hay.
154154
///
155-
/// See documentation of [`Searcher`] for an example.
155+
/// See documentation of [`Searcher`](trait.Searcher.html) for an example.
156156
///
157157
/// # Safety
158158
///
@@ -163,13 +163,13 @@ pub unsafe trait Consumer<A: Hay + ?Sized> {
163163
/// Checks if the needle can be found at the beginning of the span.
164164
///
165165
/// This method is used to implement the standard algorithm
166-
/// [`starts_with()`](std::needle::ext::starts_with) as well as providing the default
167-
/// implementation for [`.trim_start()`](Consumer::trim_start).
166+
/// [`starts_with()`](ext/fn.starts_with.html) as well as providing
167+
/// the default implementation for [`.trim_start()`](#method.trim_start).
168168
///
169169
/// The hay and the restricted range for searching can be recovered by
170-
/// calling `span`[`.into_parts()`](Span::into_parts). If a needle can be
171-
/// found starting at `range.start`, this method should return the end index
172-
/// of the needle relative to the hay.
170+
/// calling `span`[`.into_parts()`](struct.Span.html#method.into_parts).
171+
/// If a needle can be found starting at `range.start`, this method should
172+
/// return the end index of the needle relative to the hay.
173173
///
174174
/// If the needle cannot be found at the beginning of the span, this method
175175
/// should return `None`.
@@ -203,12 +203,12 @@ pub unsafe trait Consumer<A: Hay + ?Sized> {
203203
/// Repeatedly removes prefixes of the hay which matches the needle.
204204
///
205205
/// This method is used to implement the standard algorithm
206-
/// [`trim_start()`](std::needle::ext::trim_start).
206+
/// [`trim_start()`](ext/fn.trim_start.html).
207207
///
208208
/// Returns the start index of the slice after all prefixes are removed.
209209
///
210210
/// A fast generic implementation in terms of
211-
/// [`.consume()`](Consumer::consume) is provided by default. Nevertheless,
211+
/// [`.consume()`](#method.consume) is provided by default. Nevertheless,
212212
/// many needles allow a higher-performance specialization.
213213
///
214214
/// # Examples
@@ -254,19 +254,19 @@ pub unsafe trait ReverseSearcher<A: Hay + ?Sized>: Searcher<A> {
254254
///
255255
/// This method is used to support the following standard algorithms:
256256
///
257-
/// * [`rmatches`](std::needle::ext::rmatches)
258-
/// * [`rmatch_indices`](std::needle::ext::rmatch_indices)
259-
/// * [`rfind`](std::needle::ext::find)
260-
/// * [`rmatch_ranges`](std::needle::ext::rmatch_ranges)
261-
/// * [`rfind_range`](std::needle::ext::rfind_range)
262-
/// * [`rsplit`](std::needle::ext::rsplit)
263-
/// * [`rsplit_terminator`](std::needle::ext::rsplit_terminator)
264-
/// * [`rsplitn`](std::needle::ext::rsplitn)
257+
/// * [`rmatches`](ext/fn.rmatches.html)
258+
/// * [`rmatch_indices`](ext/fn.rmatch_indices.html)
259+
/// * [`rfind`](ext/fn.find.html)
260+
/// * [`rmatch_ranges`](ext/fn.rmatch_ranges.html)
261+
/// * [`rfind_range`](ext/fn.rfind_range.html)
262+
/// * [`rsplit`](ext/fn.rsplit.html)
263+
/// * [`rsplit_terminator`](ext/fn.rsplit_terminator.html)
264+
/// * [`rsplitn`](ext/fn.rsplitn.html)
265265
///
266266
/// The hay and the restricted range for searching can be recovered by
267-
/// calling `span`[`.into_parts()`](Span::into_parts). The returned range
268-
/// should be relative to the hay and must be contained within the
269-
/// restricted range from the span.
267+
/// calling `span`[`.into_parts()`](struct.Span.html#method.into_parts).
268+
/// The returned range should be relative to the hay and must be contained
269+
/// within the restricted range from the span.
270270
///
271271
/// If the needle is not found, this method should return `None`.
272272
///
@@ -314,13 +314,13 @@ pub unsafe trait ReverseConsumer<A: Hay + ?Sized>: Consumer<A> {
314314
/// Checks if the needle can be found at the end of the span.
315315
///
316316
/// This method is used to implement the standard algorithm
317-
/// [`ends_with()`](std::needle::ext::ends_with) as well as providing the default
318-
/// implementation for [`.trim_end()`](ReverseConsumer::trim_end).
317+
/// [`ends_with()`](ext/fn.ends_with.html) as well as providing the default
318+
/// implementation for [`.trim_end()`](#method.trim_end).
319319
///
320320
/// The hay and the restricted range for searching can be recovered by
321-
/// calling `span`[`.into_parts()`](Span::into_parts). If a needle can be
322-
/// found ending at `range.end`, this method should return the start index
323-
/// of the needle relative to the hay.
321+
/// calling `span`[`.into_parts()`](struct.Span.html#method.into_parts).
322+
/// If a needle can be found ending at `range.end`, this method should
323+
/// return the start index of the needle relative to the hay.
324324
///
325325
/// If the needle cannot be found at the end of the span, this method
326326
/// should return `None`.
@@ -354,10 +354,10 @@ pub unsafe trait ReverseConsumer<A: Hay + ?Sized>: Consumer<A> {
354354
/// Repeatedly removes suffixes of the hay which matches the needle.
355355
///
356356
/// This method is used to implement the standard algorithm
357-
/// [`trim_end()`](std::needle::ext::trim_end).
357+
/// [`trim_end()`](ext/fn.trim_end.html).
358358
///
359359
/// A fast generic implementation in terms of
360-
/// [`.rconsume()`](ReverseConsumer::rconsume) is provided by default.
360+
/// [`.rconsume()`](#method.rconsume) is provided by default.
361361
/// Nevertheless, many needles allow a higher-performance specialization.
362362
///
363363
/// # Examples
@@ -391,20 +391,20 @@ pub unsafe trait ReverseConsumer<A: Hay + ?Sized>: Consumer<A> {
391391
/// A searcher which can be searched from both end with consistent results.
392392
///
393393
/// Implementing this marker trait enables the following standard algorithms to
394-
/// return [`DoubleEndedIterator`](std::iter::DoubleEndedIterator)s:
395-
///
396-
/// * [`matches`](std::needle::ext::matches) /
397-
/// [`rmatches`](std::needle::ext::rmatches)
398-
/// * [`match_indices`](std::needle::ext::match_indices) /
399-
/// [`rmatch_indices`](std::needle::ext::rmatch_indices)
400-
/// * [`match_ranges`](std::needle::ext::match_ranges) /
401-
/// [`rmatch_ranges`](std::needle::ext::rmatch_ranges)
402-
/// * [`split`](std::needle::ext::split) /
403-
/// [`rsplit`](std::needle::ext::rsplit)
404-
/// * [`split_terminator`](std::needle::ext::split_terminator) /
405-
/// [`rsplit_terminator`](std::needle::ext::rsplit_terminator)
406-
/// * [`splitn`](std::needle::ext::splitn) /
407-
/// [`rsplitn`](std::needle::ext::rsplitn)
394+
/// return [`DoubleEndedIterator`](../iter/trait.DoubleEndedIterator.html)s:
395+
///
396+
/// * [`matches`](ext/fn.matches.html) /
397+
/// [`rmatches`](ext/fn.rmatches.html)
398+
/// * [`match_indices`](ext/fn.match_indices.html) /
399+
/// [`rmatch_indices`](ext/fn.rmatch_indices.html)`
400+
/// * [`match_ranges`](ext/fn.match_ranges.html) /
401+
/// [`rmatch_ranges`](ext/fn.rmatch_ranges.html)
402+
/// * [`split`](ext/fn.split.html) /
403+
/// [`rsplit`](ext/fn.rsplit.html)
404+
/// * [`split_terminator`](ext/fn.split_terminator.html) /
405+
/// [`rsplit_terminator`](ext/fn.rsplit_terminator.html)
406+
/// * [`splitn`](ext/fn.splitn.html) /
407+
/// [`rsplitn`](ext/fn.rsplitn.html)
408408
///
409409
/// # Examples
410410
///
@@ -442,10 +442,10 @@ pub unsafe trait DoubleEndedSearcher<A: Hay + ?Sized>: ReverseSearcher<A> {}
442442
///
443443
/// It is used to support the following standard algorithm:
444444
///
445-
/// * [`trim`](std::needle::ext::trim)
445+
/// * [`trim`](ext/fn.trim.html)
446446
///
447447
/// The `trim` function is implemented by calling
448-
/// [`trim_start`](std::needle::ext::trim_start) and [`trim_end`](std::needle::ext::trim_end)
448+
/// [`trim_start`](ext/fn.trim_start.html) and [`trim_end`](ext/fn.trim_end.html)
449449
/// together. This trait encodes the fact that we can call these two functions in any order.
450450
///
451451
/// # Examples
@@ -477,11 +477,11 @@ pub unsafe trait DoubleEndedConsumer<A: Hay + ?Sized>: ReverseConsumer<A> {}
477477

478478
/// A needle, a type which can be converted into a searcher.
479479
///
480-
/// When using search algorithms like [`split()`](std::needle::ext::split), users will
480+
/// When using search algorithms like [`split()`](ext/fn.split.html), users will
481481
/// search with a `Needle` e.g. a `&str`. A needle is usually stateless,
482482
/// however for efficient searching, we often need some preprocessing and
483483
/// maintain a mutable state. The preprocessed structure is called the
484-
/// [`Searcher`] of this needle.
484+
/// [`Searcher`](trait.Searcher.html) of this needle.
485485
///
486486
/// The relationship between `Searcher` and `Needle` is similar to `Iterator`
487487
/// and `IntoIterator`.

src/libcore/str/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2883,7 +2883,7 @@ impl str {
28832883
/// Equivalent to [`rsplit`], except that the trailing substring is
28842884
/// skipped if empty.
28852885
///
2886-
/// [`split`]: #method.split
2886+
/// [`rsplit`]: #method.rsplit
28872887
///
28882888
/// This method can be used for string data that is _terminated_,
28892889
/// rather than _separated_ by a pattern.

0 commit comments

Comments
 (0)