Get the end location of this range.
(sr: &SourceRange)
| 29 | |
| 30 | /// Get the end location of this range. |
| 31 | pub fn get_sr_end_loc(sr: &SourceRange) -> Result<&BareSourceLocation> { |
| 32 | if let Some(end) = &sr.end.spelling_loc { |
| 33 | if end.file.ends_with(".cc") { |
| 34 | return Ok(end); |
| 35 | } |
| 36 | } |
| 37 | if let Some(end) = &sr.end.expansion_loc { |
| 38 | if end.file.ends_with(".cc") { |
| 39 | return Ok(end); |
| 40 | } |
| 41 | } |
| 42 | eyre::bail!("cannot get end from SourceRange: {sr:?}") |
| 43 | } |
| 44 | |
| 45 | /// Get the source file offsets of this range. |
| 46 | pub fn get_sr_offset(sr: &SourceRange) -> Result<(usize, usize)> { |
no outgoing calls
no test coverage detected