File tree Expand file tree Collapse file tree 1 file changed +20
-11
lines changed Expand file tree Collapse file tree 1 file changed +20
-11
lines changed Original file line number Diff line number Diff line change @@ -1318,17 +1318,26 @@ impl<D: Decoder> Decodable<D> for SourceFile {
13181318 let mut line_start: BytePos = Decodable :: decode ( d) ;
13191319 lines. push ( line_start) ;
13201320
1321- for _ in 1 ..num_lines {
1322- let diff = match bytes_per_diff {
1323- 1 => d. read_u8 ( ) as u32 ,
1324- 2 => d. read_u16 ( ) as u32 ,
1325- 4 => d. read_u32 ( ) ,
1326- _ => unreachable ! ( ) ,
1327- } ;
1328-
1329- line_start = line_start + BytePos ( diff) ;
1330-
1331- lines. push ( line_start) ;
1321+ match bytes_per_diff {
1322+ 1 => {
1323+ for _ in 1 ..num_lines {
1324+ line_start = line_start + BytePos ( d. read_u8 ( ) as u32 ) ;
1325+ lines. push ( line_start) ;
1326+ }
1327+ }
1328+ 2 => {
1329+ for _ in 1 ..num_lines {
1330+ line_start = line_start + BytePos ( d. read_u16 ( ) as u32 ) ;
1331+ lines. push ( line_start) ;
1332+ }
1333+ }
1334+ 4 => {
1335+ for _ in 1 ..num_lines {
1336+ line_start = line_start + BytePos ( d. read_u32 ( ) ) ;
1337+ lines. push ( line_start) ;
1338+ }
1339+ }
1340+ _ => unreachable ! ( ) ,
13321341 }
13331342 }
13341343
You can’t perform that action at this time.
0 commit comments