From 60172ced95b4ab1dfd9a7591cfa3e5591bb72f48 Mon Sep 17 00:00:00 2001 From: vnrst <116316945+vnrst@users.noreply.github.com> Date: Tue, 8 Nov 2022 23:08:28 -0500 Subject: [PATCH] Update lifetimes of `read_complex_string` --- src/parser.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parser.rs b/src/parser.rs index 8fab0df..46946d8 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -482,7 +482,7 @@ impl<'a> Parser<'a> { // is whole lot slower than parsing "foobar", as the former suffers from // having to be read from source to a buffer and then from a buffer to // our target string. Nothing to be done about this, really. - fn read_complex_string<'b>(&mut self, start: usize) -> Result<&'b str> { + fn read_complex_string(&mut self, start: usize) -> Result<&'_ str> { // Since string slices are returned by this function that are created via pointers into `self.buffer` // we shouldn't be clearing or modifying the buffer in consecutive calls to this function. Instead // we continuously append bytes to `self.buffer` and keep track of the starting offset of the buffer on each @@ -894,4 +894,4 @@ mod tests { assert_eq!(actual, expected); } -} \ No newline at end of file +}