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

Function attributes

atomic-audit/src/substantive/rust.rs:79–95  ·  view source on GitHub ↗
(node: Node<'_>)

Source from the content-addressed store, hash-verified

77}
78
79fn attributes(node: Node<'_>) -> Vec<Node<'_>> {
80 let mut result = Vec::new();
81 let mut previous = node.prev_named_sibling();
82 while let Some(node) = previous {
83 if !matches!(
84 node.kind(),
85 "attribute_item" | "line_comment" | "block_comment"
86 ) {
87 break;
88 }
89 if node.kind() == "attribute_item" {
90 result.push(node);
91 }
92 previous = node.prev_named_sibling();
93 }
94 result
95}
96
97fn has_attribute(node: Node<'_>, context: &Context<'_>, expected: &str) -> bool {
98 attributes(node).into_iter().any(|attribute| {

Callers 2

has_attributeFunction · 0.85
forwarding_wrapperFunction · 0.85

Calls 2

kindMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected