Skip to content

Is there any way to collect method chains? #14700

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
callanchen opened this issue Apr 28, 2025 · 1 comment
Closed

Is there any way to collect method chains? #14700

callanchen opened this issue Apr 28, 2025 · 1 comment

Comments

@callanchen
Copy link

callanchen commented Apr 28, 2025

I'm writing a lint, but I want to get the names of all function calls in a chain.

How should I do this?

Such as:

let _ = S::build()
     .fun1()
     .fun2()
     .fun3();

I can get the Expr of "S::build()", but I can not find a good way to collect other function names in the chain.

@callanchen
Copy link
Author

I find a help function in clippy_utils. I close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant