-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Unnecessary parens could warn on let foo = (bar);
#12350
Comments
I'll give it a try. I think this could be extended to operator assignments, too: let mut foo = 0;
let bar = 1;
foo += (bar); // here |
@aepsil0n sounds good: it should be possible to extend the match in |
I sometimes use "unnecessary" parens in order to compensate for my editor's (Emacs with rust-mode.el) auto-indent, e.g.: let a = if b { c }
else { d };
// versus
let a = (if b { c }
else { d }); Not sure whether I would just disable the |
@pnkfelix Since there is no significant whitespace in Rust (unlike e.g. Python, where this totally makes sense), I'd intuitively say, that's an editor issue and not a syntax issue. Anyway, how would you check the expression for whether it's multiline? |
@aepsil0n You could check whether the expression crosses lines by using the expression's But as I tried to indicate, it could just be a matter of personal preference, and I can always disable the lint in my own projects. |
Yeah, I'll leave it out for now. Just being curious. ^^ |
Fix build on OpenBSD (and probably other BSDs too) notify-5.0.0-pre.14 does not build on these systems; this was fixed in notify-rs/notify@41a74f0 , which landed in pre.15.
…olors, r=xFrednet style: sync GitHub Corner colors fixes rust-lang#12349. *Please write a short comment explaining your change (or "none" for internal only changes)* changelog: sync site GitHub Corner colors
Just another case that the
unnecessary-parens
lint could warn about. I don't think that the parens serve any use in that situation.The text was updated successfully, but these errors were encountered: