diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
commit | 64d98f8ee037282c35007b64c2649055c56af1db (patch) | |
tree | 5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /vendor/pest/src/error.rs | |
parent | Adding debian version 1.67.1+dfsg1-1. (diff) | |
download | rustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/pest/src/error.rs')
-rw-r--r-- | vendor/pest/src/error.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/vendor/pest/src/error.rs b/vendor/pest/src/error.rs index a83e23a49..eef004233 100644 --- a/vendor/pest/src/error.rs +++ b/vendor/pest/src/error.rs @@ -101,7 +101,7 @@ impl<R: RuleType> Error<R> { /// /// println!("{}", error); /// ``` - pub fn new_from_pos(variant: ErrorVariant<R>, pos: Position) -> Error<R> { + pub fn new_from_pos(variant: ErrorVariant<R>, pos: Position<'_>) -> Error<R> { let visualize_ws = pos.match_char('\n') || pos.match_char('\r'); let line_of = pos.line_of(); let line = if visualize_ws { @@ -147,7 +147,7 @@ impl<R: RuleType> Error<R> { /// /// println!("{}", error); /// ``` - pub fn new_from_span(variant: ErrorVariant<R>, span: Span) -> Error<R> { + pub fn new_from_span(variant: ErrorVariant<R>, span: Span<'_>) -> Error<R> { let end = span.end_pos(); let mut end_line_col = end.line_col(); // end position is after a \n, so we want to point to the visual lf symbol @@ -170,7 +170,7 @@ impl<R: RuleType> Error<R> { }; let ll = line_iter.last(); let continued_line = if visualize_ws { - ll.map(&str::to_owned) + ll.map(str::to_owned) } else { ll.map(visualize_whitespace) }; @@ -505,7 +505,7 @@ impl<R: RuleType> ErrorVariant<R> { /// }; /// /// println!("{}", variant.message()); - pub fn message(&self) -> Cow<str> { + pub fn message(&self) -> Cow<'_, str> { match self { ErrorVariant::ParsingError { ref positives, @@ -519,13 +519,13 @@ impl<R: RuleType> ErrorVariant<R> { } impl<R: RuleType> fmt::Display for Error<R> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{}", self.format()) } } impl<R: RuleType> fmt::Display for ErrorVariant<R> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { ErrorVariant::ParsingError { .. } => write!(f, "parsing error: {}", self.message()), ErrorVariant::CustomError { .. } => write!(f, "{}", self.message()), |