-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesCategory: Enhancement of lints, like adding more cases or adding help messagesE-hardCall for participation: This a hard problem and requires more experience or effort to work onCall for participation: This a hard problem and requires more experience or effort to work onI-false-negativeIssue: The lint should have been triggered on code, but wasn'tIssue: The lint should have been triggered on code, but wasn't
Description
Lint name: if_same_then_else
I tried this code: https://github.com/deltachat/deltachat-core-rust/blob/master/src/message.rs#L1081-L1091
if chat.id.is_deaddrop() {
if let Some(contact) = contact {
self.text1 = Some(msg.get_sender_name(contact));
} else {
self.text1 = None;
}
} else if let Some(contact) = contact {
self.text1 = Some(msg.get_sender_name(contact));
} else {
self.text1 = None;
}
I expected to see this happen: detect that chat.id.is_deaddrop()
condition could be removed.
Instead, this happened: clippy did not detect anything.
Meta
cargo clippy -V
: clippy 0.0.212 (e1884a8 2020-12-29)rustc -Vv
:rustc 1.49.0 (e1884a8e3 2020-12-29) binary: rustc commit-hash: e1884a8e3c3e813aada8254edfa120e85bf5ffca commit-date: 2020-12-29 host: x86_64-unknown-linux-gnu release: 1.49.0
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesCategory: Enhancement of lints, like adding more cases or adding help messagesE-hardCall for participation: This a hard problem and requires more experience or effort to work onCall for participation: This a hard problem and requires more experience or effort to work onI-false-negativeIssue: The lint should have been triggered on code, but wasn'tIssue: The lint should have been triggered on code, but wasn't
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity