Skip to content

Commit

Permalink
Fix some clippy warnings about redundant ifs
Browse files Browse the repository at this point in the history
  • Loading branch information
sdroege committed Dec 17, 2019
1 parent f86f610 commit 415d9ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/analysis/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -721,10 +721,10 @@ fn analyze_function(
}

if !commented {
if !destroys.is_empty() || !callbacks.is_empty() {
if callbacks.iter().any(|c| !c.scope.is_call()) {
imports.add("std::boxed::Box as Box_");
}
if (!destroys.is_empty() || !callbacks.is_empty())
&& callbacks.iter().any(|c| !c.scope.is_call())
{
imports.add("std::boxed::Box as Box_");
}
if !commented {
for transformation in &mut parameters.transformations {
Expand Down
6 changes: 2 additions & 4 deletions src/analysis/trampolines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,8 @@ pub fn analyze(

//TODO: move to object.signal.return config
let inhibit = configured_signals.iter().any(|f| f.inhibit);
if inhibit {
if signal.ret.typ != library::TypeId::tid_bool() {
error!("Wrong return type for Inhibit for signal '{}'", signal.name);
}
if inhibit && signal.ret.typ != library::TypeId::tid_bool() {
error!("Wrong return type for Inhibit for signal '{}'", signal.name);
}

let mut bounds: Bounds = Default::default();
Expand Down

0 comments on commit 415d9ac

Please sign in to comment.