Skip to content

Fix some clippy lints that were previously 'allow'ed #1843

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

Merged
merged 2 commits into from
Apr 26, 2020

Conversation

coolreader18
Copy link
Member

No description provided.

@@ -768,8 +768,7 @@ impl VirtualMachine {
self.trace_event(TraceEvent::Return)?;
result
} else if class.has_attr("__call__") {
let result = self.call_method(&callable, "__call__", args);
result
self.call_method(&callable, "__call__", args)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These patterns were actually more debugger-friendly than now.
Do we prefer cleaner code than debugger friendly code?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, like being able to see the value of result there? I'm not sure, I don't use traditional debuggers that let you step through, but I'd think that there might be some way to see the value of an expression after it executes? I'm not sure.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, exactly that use case. I just know this kind of "single expression for one line" or "single side effect for one line" is a traditional recommendation for debugger-friendly code. Because I am not a heavy user of debuggers, probably there must be experts who know better about this problem.

@youknowone youknowone merged commit 9b3fa53 into master Apr 26, 2020
@youknowone youknowone deleted the coolreader18/clippy-fixes branch April 26, 2020 15:10
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 this pull request may close these issues.

3 participants