pub(crate) fn remove_call_attributes(attributes: &mut Vec<Attribute>) -> Option<CallAttributes> {
    let mut forward = None;
    let mut assure_attributes = Vec::new();

    let preconditions_span = visit_matching_attrs_parsed(
        attributes,
        |attr| is_attr("assure", attr),
        |Parenthesized {
             content: mut assure_attribute,
             ..
         }: Parenthesized<AssureAttr>,
         span| {
            assure_attribute.set_span(span);

            assure_attributes.push(assure_attribute);
        },
    );
    let forward_span = visit_matching_attrs_parsed(
        attributes,
        |attr| is_attr("forward", attr),
        |Parenthesized {
             content: mut fwd, ..
         }: Parenthesized<Forward>,
         span| {
            fwd.set_span(span);

            if let Some(old_forward) = forward.replace(fwd) {
                emit_error!(
                    span,
                    "duplicate `forward` attribute";
                    help = old_forward.span() => "there can be just one location, try removing the wrong one"
                );
            }
        },
    );

    let span = match (preconditions_span, forward_span) {
        (Some(preconditions_span), Some(forward_span)) => Some(
            preconditions_span
                .join(forward_span)
                .unwrap_or_else(|| preconditions_span),
        ),
        (Some(span), None) => Some(span),
        (None, Some(span)) => Some(span),
        (None, None) => None,
    };

    if let Some(span) = span {
        Some(CallAttributes {
            span,
            forward,
            assure_attributes,
        })
    } else {
        None
    }
}
/// Removes and returns all `pre`-related call-site attributes from the given attribute list.
Removes and returns all `pre`-related call-site attributes from the given attribute list.
Removes and returns all ` pre ` - related call - site attributes from the given attribute list .
pub(crate) fn remove_call_attributes(attributes: &mut Vec<Attribute>) -> Option<CallAttributes> {
    let mut forward = None;
    let mut assure_attributes = Vec::new();
    let preconditions_span = visit_matching_attrs_parsed(
        attributes,
        |attr| is_attr("assure", attr),
        |Parenthesized {
             content: mut assure_attribute,
             ..
         }: Parenthesized<AssureAttr>,
         span| {
            assure_attribute.set_span(span);
            assure_attributes.push(assure_attribute);
        },
    );
    let forward_span = visit_matching_attrs_parsed(
        attributes,
        |attr| is_attr("forward", attr),
        |Parenthesized {
             content: mut fwd, ..
         }: Parenthesized<Forward>,
         span| {
            fwd.set_span(span);
            if let Some(old_forward) = forward.replace(fwd) {
                emit_error!(
                    span,
                    "duplicate `forward` attribute";
                    help = old_forward.span() => "there can be just one location, try removing the wrong one"
                );
            }
        },
    );
    let span = match (preconditions_span, forward_span) {
        (Some(preconditions_span), Some(forward_span)) => Some(
            preconditions_span
                .join(forward_span)
                .unwrap_or_else(|| preconditions_span),
        ),
        (Some(span), None) => Some(span),
        (None, Some(span)) => Some(span),
        (None, None) => None,
    };
    if let Some(span) = span {
        Some(CallAttributes {
            span,
            forward,
            assure_attributes,
        })
    } else {
        None
    }
}
pub ( crate ) fn remove_call_attributes ( attributes : & mut Vec < Attribute > ) -> Option < CallAttributes > { let mut forward = None ; let mut assure_attributes = Vec :: new ( ) ; let preconditions_span = visit_matching_attrs_parsed ( attributes , | attr | is_attr ( " " , attr ) , | Parenthesized { content : mut assure_attribute , .. } : Parenthesized < AssureAttr > , span | { assure_attribute . set_span ( span ) ; assure_attributes . push ( assure_attribute ) ; } , ) ; let forward_span = visit_matching_attrs_parsed ( attributes , | attr | is_attr ( " " , attr ) , | Parenthesized { content : mut fwd , .. } : Parenthesized < Forward > , span | { fwd . set_span ( span ) ; if let Some ( old_forward ) = forward . replace ( fwd ) { emit_error ! ( span " " help old_forward span ( ) " " ) ; } } , ) ; let span = match ( preconditions_span , forward_span ) { ( Some ( preconditions_span ) , Some ( forward_span ) ) => Some ( preconditions_span . join ( forward_span ) . unwrap_or_else ( | | preconditions_span ) , ) , ( Some ( span ) , None ) => Some ( span ) , ( None , Some ( span ) ) => Some ( span ) , ( None , None ) => None , } ; if let Some ( span ) = span { Some ( CallAttributes { span , forward , assure_attributes , } ) } else { None } }
Removes and returns all `pre`-related call-site attributes from the given attribute list.
Removes and returns all ` pre ` - related call - site attributes from the given attribute list .
attributes
&mut Vec<Attribute>
attributes
&mut Vec<Attribute>