(vd_end: &BareSourceLocation, src_file: &Path)
| 91 | } |
| 92 | |
| 93 | fn get_vd_end_offset(vd_end: &BareSourceLocation, src_file: &Path) -> Result<usize> { |
| 94 | let buffer = std::fs::read_to_string(src_file).unwrap(); |
| 95 | let end_loc = vd_end.offset + vd_end.tok_len; |
| 96 | let buf = &buffer[end_loc..]; |
| 97 | let comma_offset = buf.find(','); |
| 98 | let semicolon_offset = buf.find(';'); |
| 99 | if comma_offset.is_none() { |
| 100 | return Ok(end_loc + semicolon_offset.unwrap()); |
| 101 | } |
| 102 | if comma_offset.unwrap() < semicolon_offset.unwrap() { |
| 103 | return Ok(end_loc + comma_offset.unwrap()); |
| 104 | } |
| 105 | Ok(end_loc + semicolon_offset.unwrap()) |
| 106 | } |
| 107 | |
| 108 | /// if there is other vd in this range. |
| 109 | fn has_other_before_vd( |
no test coverage detected