Skip to content

Commit 8f13fc9

Browse files
authored
Further clarifications in docs for what errors are returned. (#380)
Based on #281
1 parent e95c5be commit 8f13fc9

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/nth.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use super::{BasicParseError, Parser, ParserInput, Token};
77
/// Parse the *An+B* notation, as found in the `:nth-child()` selector.
88
/// The input is typically the arguments of a function,
99
/// in which case the caller needs to check if the arguments’ parser is exhausted.
10-
/// Return `Ok((A, B))`, or `Err(())` for a syntax error.
10+
/// Return `Ok((A, B))`, or an `Err(..)` for a syntax error.
1111
pub fn parse_nth<'i>(input: &mut Parser<'i, '_>) -> Result<(i32, i32), BasicParseError<'i>> {
1212
match *input.next()? {
1313
Token::Number {

src/parser.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ impl<'i: 't, 't> Parser<'i, 't> {
698698
///
699699
/// Successful results are accumulated in a vector.
700700
///
701-
/// This method returns `Err(())` the first time that a closure call does,
701+
/// This method returns an`Err(..)` the first time that a closure call does,
702702
/// or if a closure call leaves some input before the next comma or the end
703703
/// of the input.
704704
#[inline]

src/rules_and_declarations.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub trait DeclarationParser<'i> {
3434
///
3535
/// Return the finished representation for the declaration
3636
/// as returned by `DeclarationListParser::next`,
37-
/// or `Err(())` to ignore the entire declaration as invalid.
37+
/// or an `Err(..)` to ignore the entire declaration as invalid.
3838
///
3939
/// Declaration name matching should be case-insensitive in the ASCII range.
4040
/// This can be done with `std::ascii::Ascii::eq_ignore_ascii_case`,
@@ -78,7 +78,7 @@ pub trait AtRuleParser<'i> {
7878
/// Parse the prelude of an at-rule with the given `name`.
7979
///
8080
/// Return the representation of the prelude and the type of at-rule,
81-
/// or `Err(())` to ignore the entire at-rule as invalid.
81+
/// or an `Err(..)` to ignore the entire at-rule as invalid.
8282
///
8383
/// The prelude is the part after the at-keyword
8484
/// and before the `;` semicolon or `{ /* ... */ }` block.
@@ -122,7 +122,7 @@ pub trait AtRuleParser<'i> {
122122
///
123123
/// Return the finished representation of the at-rule
124124
/// as returned by `RuleListParser::next` or `DeclarationListParser::next`,
125-
/// or `Err(())` to ignore the entire at-rule as invalid.
125+
/// or an `Err(..)` to ignore the entire at-rule as invalid.
126126
///
127127
/// This is only called when `parse_prelude` returned `WithBlock`, and a block
128128
/// was indeed found following the prelude.
@@ -161,7 +161,7 @@ pub trait QualifiedRuleParser<'i> {
161161
/// Parse the prelude of a qualified rule. For style rules, this is as Selector list.
162162
///
163163
/// Return the representation of the prelude,
164-
/// or `Err(())` to ignore the entire at-rule as invalid.
164+
/// or an `Err(..)` to ignore the entire at-rule as invalid.
165165
///
166166
/// The prelude is the part before the `{ /* ... */ }` block.
167167
///
@@ -180,7 +180,7 @@ pub trait QualifiedRuleParser<'i> {
180180
///
181181
/// Return the finished representation of the qualified rule
182182
/// as returned by `RuleListParser::next`,
183-
/// or `Err(())` to ignore the entire at-rule as invalid.
183+
/// or an `Err(..)` to ignore the entire at-rule as invalid.
184184
fn parse_block<'t>(
185185
&mut self,
186186
prelude: Self::Prelude,
@@ -353,7 +353,7 @@ where
353353
}
354354
}
355355

356-
/// `RuleListParser` is an iterator that yields `Ok(_)` for a rule or `Err(())` for an invalid one.
356+
/// `RuleListParser` is an iterator that yields `Ok(_)` for a rule or an `Err(..)` for an invalid one.
357357
impl<'i, 't, 'a, R, P, E: 'i> Iterator for StyleSheetParser<'i, 't, 'a, P>
358358
where
359359
P: QualifiedRuleParser<'i, QualifiedRule = R, Error = E>

0 commit comments

Comments
 (0)