@@ -34,7 +34,7 @@ pub struct Path<'a> {
3434}
3535
3636/// Parse a single line of a GFA file.
37- pub fn parse_line ( line : & [ u8 ] ) -> LineResult {
37+ pub fn parse_line ( line : & [ u8 ] ) -> LineResult < ' _ > {
3838 if line. len ( ) < 2 || line[ 1 ] != b'\t' {
3939 return Err ( "expected marker and tab" ) ;
4040 }
@@ -49,20 +49,20 @@ pub fn parse_line(line: &[u8]) -> LineResult {
4949}
5050
5151/// Parse a header line, which looks like `H <data>`.
52- fn parse_header ( line : & [ u8 ] ) -> LineResult {
52+ fn parse_header ( line : & [ u8 ] ) -> LineResult < ' _ > {
5353 Ok ( Line :: Header ( line) )
5454}
5555
5656/// Parse a segment line, which looks like `S <name> <seq> <data>`.
57- fn parse_seg ( line : & [ u8 ] ) -> LineResult {
57+ fn parse_seg ( line : & [ u8 ] ) -> LineResult < ' _ > {
5858 let ( name, rest) = parse_num ( line) ?;
5959 let rest = parse_byte ( rest, b'\t' ) ?;
6060 let ( seq, data) = parse_field ( rest) ?;
6161 Ok ( Line :: Segment ( Segment { name, seq, data } ) )
6262}
6363
6464/// Parse a link line, which looks like `L <from> <+-> <to> <+-> <CIGAR>`.
65- fn parse_link ( line : & [ u8 ] ) -> LineResult {
65+ fn parse_link ( line : & [ u8 ] ) -> LineResult < ' _ > {
6666 let ( from_seg, rest) = parse_num ( line) ?;
6767 let rest = parse_byte ( rest, b'\t' ) ?;
6868 let ( from_orient, rest) = parse_orient ( rest) ?;
@@ -85,7 +85,7 @@ fn parse_link(line: &[u8]) -> LineResult {
8585}
8686
8787/// Parse a path line, which looks like `P <name> <steps> <*|CIGARs>`.
88- fn parse_path ( line : & [ u8 ] ) -> LineResult {
88+ fn parse_path ( line : & [ u8 ] ) -> LineResult < ' _ > {
8989 let ( name, rest) = parse_field ( line) ?;
9090 let ( steps, rest) = parse_field ( rest) ?;
9191 let ( overlaps, rest) = parse_maybe_overlap_list ( rest) ?;
@@ -100,7 +100,7 @@ fn parse_path(line: &[u8]) -> LineResult {
100100}
101101
102102/// Parse a *possible* overlap list, which may be `*` (empty).
103- pub fn parse_maybe_overlap_list ( s : & [ u8 ] ) -> PartialParseResult < Vec < Vec < AlignOp > > > {
103+ pub fn parse_maybe_overlap_list ( s : & [ u8 ] ) -> PartialParseResult < ' _ , Vec < Vec < AlignOp > > > {
104104 if s == b"*" {
105105 Ok ( ( vec ! [ ] , & s[ 1 ..] ) )
106106 } else {
@@ -111,7 +111,7 @@ pub fn parse_maybe_overlap_list(s: &[u8]) -> PartialParseResult<Vec<Vec<AlignOp>
111111/// Parse a comma-separated list of CIGAR strings.
112112///
113113/// TODO: This could be optimized to avoid accumulating into a vector.
114- fn parse_overlap_list ( s : & [ u8 ] ) -> PartialParseResult < Vec < Vec < AlignOp > > > {
114+ fn parse_overlap_list ( s : & [ u8 ] ) -> PartialParseResult < ' _ , Vec < Vec < AlignOp > > > {
115115 let mut rest = s;
116116 let mut overlaps = vec ! [ ] ;
117117 while !rest. is_empty ( ) {
@@ -126,7 +126,7 @@ fn parse_overlap_list(s: &[u8]) -> PartialParseResult<Vec<Vec<AlignOp>>> {
126126}
127127
128128/// Consume a chunk of a string up to a given marker byte.
129- fn parse_until ( line : & [ u8 ] , marker : u8 ) -> PartialParseResult < & [ u8 ] > {
129+ fn parse_until ( line : & [ u8 ] , marker : u8 ) -> PartialParseResult < ' _ , & [ u8 ] > {
130130 let end = memchr:: memchr ( marker, line) . unwrap_or ( line. len ( ) ) ;
131131 let rest = if end == line. len ( ) {
132132 & [ ]
@@ -137,7 +137,7 @@ fn parse_until(line: &[u8], marker: u8) -> PartialParseResult<&[u8]> {
137137}
138138
139139/// Consume a string from the line, until a tab (or the end of the line).
140- pub fn parse_field ( line : & [ u8 ] ) -> PartialParseResult < & [ u8 ] > {
140+ pub fn parse_field ( line : & [ u8 ] ) -> PartialParseResult < ' _ , & [ u8 ] > {
141141 parse_until ( line, b'\t' )
142142}
143143
@@ -150,15 +150,15 @@ fn parse_byte(s: &[u8], byte: u8) -> ParseResult<&[u8]> {
150150}
151151
152152/// Parse a single integer.
153- fn parse_num < T : FromRadix10 > ( s : & [ u8 ] ) -> PartialParseResult < T > {
153+ fn parse_num < T : FromRadix10 > ( s : & [ u8 ] ) -> PartialParseResult < ' _ , T > {
154154 match T :: from_radix_10 ( s) {
155155 ( _, 0 ) => Err ( "expected number" ) ,
156156 ( num, used) => Ok ( ( num, & s[ used..] ) ) ,
157157 }
158158}
159159
160160/// Parse a segment orientation (+ or -).
161- fn parse_orient ( line : & [ u8 ] ) -> PartialParseResult < Orientation > {
161+ fn parse_orient ( line : & [ u8 ] ) -> PartialParseResult < ' _ , Orientation > {
162162 if line. is_empty ( ) {
163163 return Err ( "expected orientation" ) ;
164164 }
@@ -171,7 +171,7 @@ fn parse_orient(line: &[u8]) -> PartialParseResult<Orientation> {
171171}
172172
173173/// Parse a single CIGAR alignment operation (like `4D`).
174- fn parse_align_op ( s : & [ u8 ] ) -> PartialParseResult < AlignOp > {
174+ fn parse_align_op ( s : & [ u8 ] ) -> PartialParseResult < ' _ , AlignOp > {
175175 let ( len, rest) = parse_num :: < u32 > ( s) ?;
176176 let op = match rest[ 0 ] {
177177 b'M' => crate :: flatgfa:: AlignOpcode :: Match ,
@@ -186,7 +186,7 @@ fn parse_align_op(s: &[u8]) -> PartialParseResult<AlignOp> {
186186/// Parse a complete CIGAR alignment string (like `3M2I`).
187187///
188188/// TODO This could be optimized to avoid collecting into a vector.
189- fn parse_align ( s : & [ u8 ] ) -> PartialParseResult < Vec < AlignOp > > {
189+ fn parse_align ( s : & [ u8 ] ) -> PartialParseResult < ' _ , Vec < AlignOp > > {
190190 let mut rest = s;
191191 let mut align = vec ! [ ] ;
192192 while !rest. is_empty ( ) && rest[ 0 ] . is_ascii_digit ( ) {
0 commit comments