From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- vendor/pest/src/error.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'vendor/pest/src/error.rs') 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 Error { /// /// println!("{}", error); /// ``` - pub fn new_from_pos(variant: ErrorVariant, pos: Position) -> Error { + pub fn new_from_pos(variant: ErrorVariant, pos: Position<'_>) -> Error { 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 Error { /// /// println!("{}", error); /// ``` - pub fn new_from_span(variant: ErrorVariant, span: Span) -> Error { + pub fn new_from_span(variant: ErrorVariant, span: Span<'_>) -> Error { 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 Error { }; 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 ErrorVariant { /// }; /// /// println!("{}", variant.message()); - pub fn message(&self) -> Cow { + pub fn message(&self) -> Cow<'_, str> { match self { ErrorVariant::ParsingError { ref positives, @@ -519,13 +519,13 @@ impl ErrorVariant { } impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{}", self.format()) } } impl fmt::Display for ErrorVariant { - 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()), -- cgit v1.2.3