MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / at

Function at

libatomic/src/review/presentation.rs:26–44  ·  view source on GitHub ↗
(
    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

24type Key = (String, String, String, Option<u32>, Option<u32>);
25
26fn 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
46pub(super) fn metric_location(node: &GraphNode, side: &str) -> (Option<u32>, Option<u32>) {
47 let location = &node.properties[format!("{side}_location")];

Callers 1

regionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected