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

Function error_pattern

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

Source from the content-addressed store, hash-verified

99}
100
101fn error_pattern(node: Node<'_>, context: &mut Context<'_>) -> Result<bool, &'static str> {
102 let pattern = context.compact(node)?;
103 Ok([
104 "Err(",
105 "Result::Err(",
106 "std::result::Result::Err(",
107 "core::result::Result::Err(",
108 ]
109 .iter()
110 .any(|prefix| pattern.starts_with(prefix)))
111}
112
113fn success(node: Node<'_>, context: &mut Context<'_>) -> Result<bool, &'static str> {
114 if node.kind() != "call_expression" {

Callers 1

inspectFunction · 0.85

Calls 2

compactMethod · 0.80
iterMethod · 0.45

Tested by

no test coverage detected