Skip to content

Commit cd96f31

Browse files
committed
automata: fix doc links
1 parent 9fdc183 commit cd96f31

File tree

6 files changed

+50
-59
lines changed

6 files changed

+50
-59
lines changed

regex-automata/src/dfa/dense.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ const VERSION: u32 = 2;
6666
///
6767
/// The default configuration guarantees that a search will never return
6868
/// a "quit" error, although it is possible for a search to fail if
69-
/// [`Config::starts_for_each_pattern`] wasn't enabled (which it is not by
70-
/// default) and an [`Anchored::Pattern`] mode is requested via [`Input`].
69+
/// [`Config::starts_for_each_pattern`] wasn't enabled (which it is
70+
/// not by default) and an [`Anchored::Pattern`] mode is requested via
71+
/// [`Input`](crate::Input).
7172
#[cfg(feature = "dfa-build")]
7273
#[derive(Clone, Debug, Default)]
7374
pub struct Config {
@@ -113,8 +114,7 @@ impl Config {
113114
/// make searching slower than it otherwise would be if the transitions
114115
/// that leave accelerated states are traversed frequently.
115116
///
116-
/// See [`Automaton::accelerator`](crate::dfa::Automaton::accelerator) for
117-
/// an example.
117+
/// See [`Automaton::accelerator`] for an example.
118118
///
119119
/// This is enabled by default.
120120
pub fn accelerate(mut self, yes: bool) -> Config {

regex-automata/src/dfa/regex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ impl Builder {
853853
}
854854

855855
/// Set the dense DFA compilation configuration for this builder using
856-
/// [`dense::Config`](dense::Config).
856+
/// [`dense::Config`].
857857
///
858858
/// This permits setting things like whether the underlying DFAs should
859859
/// be minimized.

regex-automata/src/dfa/sparse.rs

Lines changed: 33 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ Types and routines specific to sparse DFAs.
33
44
This module is the home of [`sparse::DFA`](DFA).
55
6-
Unlike the [`dense`](super::dense) module, this module does not contain a
7-
builder or configuration specific for sparse DFAs. Instead, the intended
8-
way to build a sparse DFA is either by using a default configuration with
9-
its constructor [`sparse::DFA::new`](DFA::new), or by first configuring the
10-
construction of a dense DFA with [`dense::Builder`](super::dense::Builder)
11-
and then calling [`dense::DFA::to_sparse`](super::dense::DFA::to_sparse). For
12-
example, this configures a sparse DFA to do an overlapping search:
6+
Unlike the [`dense`] module, this module does not contain a builder or
7+
configuration specific for sparse DFAs. Instead, the intended way to build a
8+
sparse DFA is either by using a default configuration with its constructor
9+
[`sparse::DFA::new`](DFA::new), or by first configuring the construction of a
10+
dense DFA with [`dense::Builder`] and then calling [`dense::DFA::to_sparse`].
11+
For example, this configures a sparse DFA to do an overlapping search:
1312
1413
```
1514
use regex_automata::{
@@ -74,18 +73,17 @@ const VERSION: u32 = 2;
7473

7574
/// A sparse deterministic finite automaton (DFA) with variable sized states.
7675
///
77-
/// In contrast to a [dense::DFA](crate::dfa::dense::DFA), a sparse DFA uses
78-
/// a more space efficient representation for its transitions. Consequently,
79-
/// sparse DFAs may use much less memory than dense DFAs, but this comes at a
80-
/// price. In particular, reading the more space efficient transitions takes
81-
/// more work, and consequently, searching using a sparse DFA is typically
82-
/// slower than a dense DFA.
76+
/// In contrast to a [dense::DFA], a sparse DFA uses a more space efficient
77+
/// representation for its transitions. Consequently, sparse DFAs may use much
78+
/// less memory than dense DFAs, but this comes at a price. In particular,
79+
/// reading the more space efficient transitions takes more work, and
80+
/// consequently, searching using a sparse DFA is typically slower than a dense
81+
/// DFA.
8382
///
8483
/// A sparse DFA can be built using the default configuration via the
85-
/// [`DFA::new`] constructor. Otherwise, one can configure various aspects
86-
/// of a dense DFA via [`dense::Builder`](crate::dfa::dense::Builder),
87-
/// and then convert a dense DFA to a sparse DFA using
88-
/// [`dense::DFA::to_sparse`](crate::dfa::dense::DFA::to_sparse).
84+
/// [`DFA::new`] constructor. Otherwise, one can configure various aspects of a
85+
/// dense DFA via [`dense::Builder`], and then convert a dense DFA to a sparse
86+
/// DFA using [`dense::DFA::to_sparse`].
8987
///
9088
/// In general, a sparse DFA supports all the same search operations as a dense
9189
/// DFA.
@@ -140,11 +138,9 @@ impl DFA<Vec<u8>> {
140138
/// Parse the given regular expression using a default configuration and
141139
/// return the corresponding sparse DFA.
142140
///
143-
/// If you want a non-default configuration, then use
144-
/// the [`dense::Builder`](crate::dfa::dense::Builder)
145-
/// to set your own configuration, and then call
146-
/// [`dense::DFA::to_sparse`](crate::dfa::dense::DFA::to_sparse) to create
147-
/// a sparse DFA.
141+
/// If you want a non-default configuration, then use the
142+
/// [`dense::Builder`] to set your own configuration, and then call
143+
/// [`dense::DFA::to_sparse`] to create a sparse DFA.
148144
///
149145
/// # Example
150146
///
@@ -167,11 +163,9 @@ impl DFA<Vec<u8>> {
167163
/// Parse the given regular expressions using a default configuration and
168164
/// return the corresponding multi-DFA.
169165
///
170-
/// If you want a non-default configuration, then use
171-
/// the [`dense::Builder`](crate::dfa::dense::Builder)
172-
/// to set your own configuration, and then call
173-
/// [`dense::DFA::to_sparse`](crate::dfa::dense::DFA::to_sparse) to create
174-
/// a sparse DFA.
166+
/// If you want a non-default configuration, then use the
167+
/// [`dense::Builder`] to set your own configuration, and then call
168+
/// [`dense::DFA::to_sparse`] to create a sparse DFA.
175169
///
176170
/// # Example
177171
///
@@ -511,10 +505,9 @@ impl<T: AsRef<[u8]>> DFA<T> {
511505
/// * [`DFA::from_bytes`]
512506
/// * [`DFA::from_bytes_unchecked`]
513507
///
514-
/// Note that unlike a [`dense::DFA`](crate::dfa::dense::DFA)'s
515-
/// serialization methods, this does not add any initial padding to the
516-
/// returned bytes. Padding isn't required for sparse DFAs since they have
517-
/// no alignment requirements.
508+
/// Note that unlike a [`dense::DFA`]'s serialization methods, this does
509+
/// not add any initial padding to the returned bytes. Padding isn't
510+
/// required for sparse DFAs since they have no alignment requirements.
518511
///
519512
/// # Example
520513
///
@@ -553,10 +546,9 @@ impl<T: AsRef<[u8]>> DFA<T> {
553546
/// * [`DFA::from_bytes`]
554547
/// * [`DFA::from_bytes_unchecked`]
555548
///
556-
/// Note that unlike a [`dense::DFA`](crate::dfa::dense::DFA)'s
557-
/// serialization methods, this does not add any initial padding to the
558-
/// returned bytes. Padding isn't required for sparse DFAs since they have
559-
/// no alignment requirements.
549+
/// Note that unlike a [`dense::DFA`]'s serialization methods, this does
550+
/// not add any initial padding to the returned bytes. Padding isn't
551+
/// required for sparse DFAs since they have no alignment requirements.
560552
///
561553
/// # Example
562554
///
@@ -595,10 +587,9 @@ impl<T: AsRef<[u8]>> DFA<T> {
595587
/// * [`DFA::from_bytes`]
596588
/// * [`DFA::from_bytes_unchecked`]
597589
///
598-
/// Note that unlike a [`dense::DFA`](crate::dfa::dense::DFA)'s
599-
/// serialization methods, this does not add any initial padding to the
600-
/// returned bytes. Padding isn't required for sparse DFAs since they have
601-
/// no alignment requirements.
590+
/// Note that unlike a [`dense::DFA`]'s serialization methods, this does
591+
/// not add any initial padding to the returned bytes. Padding isn't
592+
/// required for sparse DFAs since they have no alignment requirements.
602593
///
603594
/// Generally speaking, native endian format should only be used when
604595
/// you know that the target you're compiling the DFA for matches the
@@ -903,9 +894,9 @@ impl<'a> DFA<&'a [u8]> {
903894
///
904895
/// If any of the above are not true, then an error will be returned.
905896
///
906-
/// Note that unlike deserializing a
907-
/// [`dense::DFA`](crate::dfa::dense::DFA), deserializing a sparse DFA has
908-
/// no alignment requirements. That is, an alignment of `1` is valid.
897+
/// Note that unlike deserializing a [`dense::DFA`], deserializing a sparse
898+
/// DFA has no alignment requirements. That is, an alignment of `1` is
899+
/// valid.
909900
///
910901
/// # Panics
911902
///

regex-automata/src/hybrid/dfa.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3213,12 +3213,12 @@ impl Config {
32133213
/// be quit bytes _only_ when a Unicode word boundary is present in the
32143214
/// pattern.
32153215
///
3216-
/// When enabling this option, callers _must_ be prepared to handle
3217-
/// a [`MatchError`](crate::MatchError) error during search.
3218-
/// When using a [`Regex`](crate::hybrid::regex::Regex), this
3219-
/// corresponds to using the `try_` suite of methods. Alternatively,
3220-
/// if callers can guarantee that their input is ASCII only, then a
3221-
/// [`MatchError::quit`] error will never be returned while searching.
3216+
/// When enabling this option, callers _must_ be prepared to
3217+
/// handle a [`MatchError`] error during search. When using a
3218+
/// [`Regex`](crate::hybrid::regex::Regex), this corresponds to using the
3219+
/// `try_` suite of methods. Alternatively, if callers can guarantee that
3220+
/// their input is ASCII only, then a [`MatchError::quit`] error will never
3221+
/// be returned while searching.
32223222
///
32233223
/// This is disabled by default.
32243224
///
@@ -3304,8 +3304,8 @@ impl Config {
33043304
/// (The advantage being that non-ASCII quit bytes will only be added if a
33053305
/// Unicode word boundary is in the pattern.)
33063306
///
3307-
/// When enabling this option, callers _must_ be prepared to handle a
3308-
/// [`MatchError`](crate::MatchError) error during search. When using a
3307+
/// When enabling this option, callers _must_ be prepared to
3308+
/// handle a [`MatchError`] error during search. When using a
33093309
/// [`Regex`](crate::hybrid::regex::Regex), this corresponds to using the
33103310
/// `try_` suite of methods.
33113311
///

regex-automata/src/hybrid/regex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ impl Builder {
878878
}
879879

880880
/// Set the lazy DFA compilation configuration for this builder using
881-
/// [`dfa::Config`](dfa::Config).
881+
/// [`dfa::Config`].
882882
///
883883
/// This permits setting things like whether Unicode word boundaries should
884884
/// be heuristically supported or settings how the behavior of the cache.

regex-automata/src/util/start.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ use crate::util::{
3131
/// the byte that occurs immediately before the start of the search.
3232
///
3333
/// Generally speaking, this type is only useful when you want to run searches
34-
/// without using an [`Input`](crate::Input). In particular, an `Input` wants a
35-
/// haystack slice, but callers may not have a contiguous sequence of bytes as
36-
/// a haystack in all cases. This type provides a lower level of control such
34+
/// without using an [`Input`]. In particular, an `Input` wants a haystack
35+
/// slice, but callers may not have a contiguous sequence of bytes as a
36+
/// haystack in all cases. This type provides a lower level of control such
3737
/// that callers can provide their own anchored configuration and look-behind
3838
/// byte explicitly.
3939
///

0 commit comments

Comments
 (0)