Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Alley <dalley@redhat.com>
  • Loading branch information
Mingun and dralley committed May 6, 2022
1 parent e090006 commit eaebf45
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/events/attributes.rs
Expand Up @@ -355,7 +355,7 @@ impl<'a> FusedIterator for Attributes<'a> {}
/// next attribute will be attempted.
#[derive(Debug, PartialEq)]
pub enum AttrError {
/// Attribute key not followed by with `=`, position relative to start of
/// Attribute key was not followed by `=`, position relative to the start of the
/// owning tag is provided.
///
/// Example of input that raises this error:
Expand All @@ -365,9 +365,9 @@ pub enum AttrError {
/// <!-- ^~~ error position, recovery position (8) -->
/// ```
///
/// That error can be raised only if iterator in XML mode.
/// This error can be raised only when the iterator is in XML mode.
ExpectedEq(usize),
/// Attribute value not found after `=`, position relative to start of owning
/// Attribute value was not found after `=`, position relative to the start of the owning
/// tag is provided.
///
/// Example of input that raises this error:
Expand All @@ -377,7 +377,7 @@ pub enum AttrError {
/// <!-- ^~~ error position, recovery position (10) -->
/// ```
///
/// Notice, that this error can be returned only for the last attribute in
/// This error can be returned only for the last attribute in
/// the list, because otherwise any content after `=` will be threated as
/// a value. The XML
///
Expand All @@ -387,11 +387,11 @@ pub enum AttrError {
/// <!-- '~~ error position (22) -->
/// ```
///
/// will be threated as `Attribute { key = b"key", value = b"another-key" }`
/// will be treated as `Attribute { key = b"key", value = b"another-key" }`
/// and or [`Attribute`] is returned, or [`AttrError::UnquotedValue`] is raised,
/// depending on the parsing mode.
ExpectedValue(usize),
/// Attribute value not quoted, position relative to start of owning tag
/// Attribute value is not quoted, position relative to the start of the owning tag
/// is provided.
///
/// Example of input that raises this error:
Expand All @@ -402,9 +402,9 @@ pub enum AttrError {
/// <!-- '~~ error position (10) -->
/// ```
///
/// That error can be raised only if iterator in XML mode.
/// This error can be raised only when the iterator is in XML mode.
UnquotedValue(usize),
/// Attribute value not finished with a matching quote, position relative to
/// Attribute value was not finished with a matching quote, position relative to the
/// start of owning tag and a quote is provided. That position is always a last
/// character in the tag content.
///
Expand All @@ -416,12 +416,12 @@ pub enum AttrError {
/// <!-- ^~~ error position, recovery position (18) -->
/// ```
///
/// Notice, that this error can be returned only for the last attribute in
/// This error can be returned only for the last attribute in
/// the list, because all input was consumed during scanning for a quote.
ExpectedQuote(usize, u8),
/// Attribute key with the same name already was defined. Two parameters
/// defines the positions relative to start of owning tag for a new attribute
/// (error position) and a previous start position of attribute with the same
/// An attribute with the same name was already encountered. Two parameters
/// define (1) the error position relative to the start of the owning tag for a new attribute
/// and (2) the start position of a previously encountered attribute with the same
/// name.
///
/// Example of input that raises this error:
Expand All @@ -433,7 +433,7 @@ pub enum AttrError {
/// <!-- '~~ previous position (4) -->
/// ```
///
/// Notice, that this error returned only if [`Attributes::with_checks()`]
/// This error is returned only when [`Attributes::with_checks()`] is set to `true`
/// was set to `true` (that is default behavior).
Duplicated(usize, usize),
}
Expand Down

0 comments on commit eaebf45

Please sign in to comment.