Skip to content

Commit 56762fe

Browse files
committed
Improved docs
1 parent 2135b55 commit 56762fe

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/cache.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub trait Cached {
5050
fn make_parser<'src>(self) -> Self::Parser<'src>;
5151
}
5252

53-
/// Allows a parser to be cached for use with inputs and outputs of difference lifetimes.
53+
/// Allows a parser to be cached for reuse with inputs and outputs of different lifetimes.
5454
pub struct Cache<C: Cached> {
5555
parser: C::Parser<'static>,
5656
#[allow(dead_code)]
@@ -75,7 +75,7 @@ impl<C: Cached> Cache<C> {
7575
/// Get a reference to the cached parser.
7676
///
7777
/// Because this function is generic over an input lifetime, the returned parser can be used in many
78-
/// difference contexts.
78+
/// different contexts.
7979
pub fn get<'src>(&self) -> &C::Parser<'src> {
8080
// SAFETY: This is safe because the API of `Cache` requires that the parser we store is bound by an arbitrary
8181
// lifetime variable (see `Cached::make_parser`). Therefore, the implementor of `Cached` has no way to

src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,9 +1420,10 @@ pub trait Parser<'a, I: Input<'a>, O, E: ParserExtra<'a, I> = extra::Default>:
14201420
/// Parse a pattern zero or more times (analog to Regex's `<PAT>*`).
14211421
///
14221422
/// Input is eagerly parsed. Be aware that the parser will accept no occurrences of the pattern too. Consider using
1423-
/// [`Repeated::at_least`] instead if it better suits your use-case.
1423+
/// [`Repeated::at_least`] instead if you wish to parse a minimum number of elements.
14241424
///
1425-
/// The output type of this parser can be any [`Container`].
1425+
/// The output type of this parser is, by default, `()`. If you want to collect the items into a [`Container`]
1426+
/// (such as a [`Vec`]), use [`IterParser::collect`].
14261427
///
14271428
/// # Examples
14281429
///
@@ -2729,7 +2730,7 @@ where
27292730
/// Internally, [`select!`] is very similar to [`Parser::try_map`] and thinking of it as such might make it less
27302731
/// confusing.
27312732
///
2732-
/// `select!` requires that tokens implement [`Clone`].
2733+
/// `select!` requires that tokens implement [`Clone`] and the input type implements [`ValueInput`].
27332734
///
27342735
/// If you're trying to access tokens referentially (for the sake of nested parsing, or simply because you want to
27352736
/// avoid cloning the token), see [`select_ref!`].

0 commit comments

Comments
 (0)