clippy_utils

Function method_chain_args

Source
pub fn method_chain_args<'a>(
    expr: &'a Expr<'_>,
    methods: &[&str],
) -> Option<Vec<(&'a Expr<'a>, &'a [Expr<'a>])>>
Expand description

Matches an Expr against a chain of methods, and return the matched Exprs.

For example, if expr represents the .baz() in foo.bar().baz(), method_chain_args(expr, &["bar", "baz"]) will return a Vec containing the Exprs for .bar() and .baz()