Skip to content

Commit 67aed3f

Browse files
authored
Fix lifetimes of substr (#138)
Signed-off-by: Christian Vetter <christian.vetter@here.com>
1 parent 0683036 commit 67aed3f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

flatdata-rs/lib/src/rawdata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ impl<'a> RawData<'a> {
2020
}
2121

2222
/// Read a \0 terminated substring starting at specified offset
23-
pub fn substring(&self, start: usize) -> Result<&str, std::str::Utf8Error> {
23+
pub fn substring(&self, start: usize) -> Result<&'a str, std::str::Utf8Error> {
2424
let suffix = &self.data[start..];
2525
match suffix.iter().position(|&c| c == 0) {
2626
Some(idx) => std::str::from_utf8(&suffix[..idx]),

0 commit comments

Comments
 (0)