Skip to content

Commit 6156a19

Browse files
authored
Merge pull request #6 from rustadopt/pr209
(json PR 209) Update lifetimes of `read_complex_string`
2 parents 5bc8b98 + a614863 commit 6156a19

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/parser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ impl<'a> Parser<'a> {
482482
// is whole lot slower than parsing "foobar", as the former suffers from
483483
// having to be read from source to a buffer and then from a buffer to
484484
// our target string. Nothing to be done about this, really.
485-
fn read_complex_string<'b>(&mut self, start: usize) -> Result<&'b str> {
485+
fn read_complex_string(&mut self, start: usize) -> Result<&'_ str> {
486486
// Since string slices are returned by this function that are created via pointers into `self.buffer`
487487
// we shouldn't be clearing or modifying the buffer in consecutive calls to this function. Instead
488488
// 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 {
894894
assert_eq!(actual, expected);
895895
}
896896

897-
}
897+
}

0 commit comments

Comments
 (0)