/// Renders the contained call in the given expression.
///
/// This only works, if the call can be unambiguosly determined.
/// Otherwise errors are printed.
Renders the contained call in the given expression.
This only works, if the call can be unambiguosly determined.
Otherwise errors are printed.
Renders the contained call in the given expression . This only works if the call can be unambiguosly determined . Otherwise errors are printed .
pub(crate) fn render_expr(expr: &mut Expr, attrs: CallAttributes) {
    if let Some(expr) = extract_call_expr(expr) {
        let call = expr
            .clone()
            .try_into()
            .expect("`extract_call_expr` should only return call expressions");
        *expr = render_call(attrs, call);
    } else {
        let emit_err = |span: Span| {
            emit_error!(
                span,
                "could not find an unambiguos call to apply this to";
                help = "try moving it closer to the call it should apply to"
            )
        };
        if let Some(forward) = attrs.forward {
            emit_err(forward.span());
        }
        for assure_attribute in attrs.assure_attributes {
            emit_err(assure_attribute.span());
        }
    }
}
pub ( crate ) fn render_expr ( expr : & mut Expr , attrs : CallAttributes ) { if let Some ( expr ) = extract_call_expr ( expr ) { let call = expr . clone ( ) . try_into ( ) . expect ( " " ) ; * expr = render_call ( attrs , call ) ; } else { let emit_err = | span : Span | { emit_error ! ( span " " help " " ) } ; if let Some ( forward ) = attrs . forward { emit_err ( forward . span ( ) ) ; } for assure_attribute in attrs . assure_attributes { emit_err ( assure_attribute . span ( ) ) ; } } }
Renders the contained call in the given expression.
Renders the contained call in the given expression .
expr
&mut Expr
attrs
CallAttributes