(needle: &str, attributes: &[syn::Attribute])
| 15 | ]; |
| 16 | |
| 17 | pub fn has_attribute(needle: &str, attributes: &[syn::Attribute]) -> bool { |
| 18 | attributes.iter().any(|attr| { |
| 19 | attr.path() |
| 20 | .segments |
| 21 | .iter() |
| 22 | .any(|segment| segment.ident == needle) |
| 23 | }) |
| 24 | } |
| 25 | |
| 26 | /// Ensures that a parsed expression is a valid Rust module-like path and the |
| 27 | /// path contains valid segments. |
no outgoing calls
no test coverage detected