MCPcopy Create free account
hub / github.com/MegEngine/MegFlow / attr

Function attr

flow-derive/src/utils.rs:35–43  ·  view source on GitHub ↗
(attrs: &'a [syn::Attribute], name: &str)

Source from the content-addressed store, hash-verified

33}
34
35pub fn attr<'a>(attrs: &'a [syn::Attribute], name: &str) -> Option<&'a syn::Attribute> {
36 attrs.iter().find(|attr| {
37 attr.path
38 .segments
39 .first()
40 .map(|p| p.ident == name)
41 .unwrap_or(false)
42 })
43}
44
45pub fn match_last_ty(ty: &syn::Type, wrapper: &str) -> bool {
46 match ty {

Callers 1

expandFunction · 0.85

Calls 1

firstMethod · 0.80

Tested by

no test coverage detected