Function
at
(
regions: &'a mut BTreeMap<Key, Region>,
change: &str,
path: &str,
side: &str,
start: Option<u32>,
end: Option<u32>,
)
Source from the content-addressed store, hash-verified
| 24 | type Key = (String, String, String, Option<u32>, Option<u32>); |
| 25 | |
| 26 | fn at<'a>( |
| 27 | regions: &'a mut BTreeMap<Key, Region>, |
| 28 | change: &str, |
| 29 | path: &str, |
| 30 | side: &str, |
| 31 | start: Option<u32>, |
| 32 | end: Option<u32>, |
| 33 | ) -> &'a mut Region { |
| 34 | regions |
| 35 | .entry((change.into(), path.into(), side.into(), start, end)) |
| 36 | .or_insert_with(|| Region { |
| 37 | change: change.into(), |
| 38 | path: path.into(), |
| 39 | side: side.into(), |
| 40 | start_line: start, |
| 41 | end_line: end, |
| 42 | ..Default::default() |
| 43 | }) |
| 44 | } |
| 45 | |
| 46 | pub(super) fn metric_location(node: &GraphNode, side: &str) -> (Option<u32>, Option<u32>) { |
| 47 | let location = &node.properties[format!("{side}_location")]; |
Tested by
no test coverage detected