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

Function success

atomic-audit/src/substantive/branching.rs:113–124  ·  view source on GitHub ↗
(node: Node<'_>, context: &mut Context<'_>)

Source from the content-addressed store, hash-verified

111}
112
113fn success(node: Node<'_>, context: &mut Context<'_>) -> Result<bool, &'static str> {
114 if node.kind() != "call_expression" {
115 return Ok(false);
116 }
117 let Some(function) = node.child_by_field_name("function") else {
118 return Ok(false);
119 };
120 Ok(matches!(
121 context.compact(function)?.as_str(),
122 "Ok" | "Result::Ok" | "std::result::Result::Ok" | "core::result::Result::Ok"
123 ))
124}
125
126fn optional_not_found(
127 pattern: Node<'_>,

Callers 3

inspectFunction · 0.70

Calls 1

kindMethod · 0.45

Tested by 2