pub(crate) fn is_attr(attr_to_check: &str, attr: &Attribute) -> bool {
    let path = &attr.path;

    if path.is_ident(attr_to_check) {
        true
    } else if path.segments.len() == 2 {
        // Note that `Path::leading_colon` is not checked here, so paths both with and without a
        // leading colon are accepted here
        path.segments[0].ident == *CRATE_NAME && path.segments[1].ident == attr_to_check
    } else {
        false
    }
}
/// Checks if the given attribute is an `attr_to_check` attribute of the main crate.
Checks if the given attribute is an `attr_to_check` attribute of the main crate.
Checks if the given attribute is an ` attr_to_check ` attribute of the main crate .
pub(crate) fn is_attr(attr_to_check: &str, attr: &Attribute) -> bool {
    let path = &attr.path;
    if path.is_ident(attr_to_check) {
        true
    } else if path.segments.len() == 2 {
        // Note that `Path::leading_colon` is not checked here, so paths both with and without a
        // leading colon are accepted here
        path.segments[0].ident == *CRATE_NAME && path.segments[1].ident == attr_to_check
    } else {
        false
    }
}
pub ( crate ) fn is_attr ( attr_to_check : & str , attr : & Attribute ) -> bool { let path = & attr . path ; if path . is_ident ( attr_to_check ) { true } else if path . segments . len ( ) == 2 { // Note that `Path::leading_colon` is not checked here, so paths both with and without a // leading colon are accepted here path . segments [ 0 ] . ident == * CRATE_NAME && path . segments [ 1 ] . ident == attr_to_check } else { false } }
Checks if the given attribute is an `attr_to_check` attribute of the main crate.
Checks if the given attribute is an ` attr_to_check ` attribute of the main crate .
attr_to_check
&str
attr
&Attribute
attr_to_check
&str
attr
&Attribute