Skip to content
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

Remove unnecessary clippy allows for new_ret_no_self #135

Closed
mulkieran opened this issue Jan 15, 2020 · 3 comments · Fixed by stratis-storage/devicemapper-rs#533
Closed
Assignees

Comments

@mulkieran
Copy link
Member

mulkieran commented Jan 15, 2020

clippy has a point; and it helps to distinguish between constructors that can't fail, and initialization actions that affect the world and can actually take action. The lint is clippy::new_ret_no_self.

@mulkieran mulkieran transferred this issue from stratis-storage/stratisd Jan 15, 2020
@mulkieran
Copy link
Member Author

clippy still claims to support this lint: https://rust-lang.github.io/rust-clippy/master/, but it seems like it is not working very well. We might need to report a bug against clippy.

@mulkieran
Copy link
Member Author

mulkieran commented Jan 16, 2020

Actually, it looks like the lint was deliberately relaxed a bit, see here: rust-lang/rust-clippy#3313 and here: rust-lang/rust-clippy#3620. I think that, so long as Self is somewhere in the return type clippy does not issue a warning.

@mulkieran mulkieran changed the title Change functions named "new" to functions named "initialize" wherever clippy complains Remove unnecessary clippy allows for new_ret_no_self Jan 16, 2020
@mulkieran
Copy link
Member Author

Resolved by attached issues.

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

Successfully merging a pull request may close this issue.

2 participants