Skip to content

Commit

Permalink
fix ignoring reported when calling get shadow (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethKnudsen97 authored Oct 15, 2024
1 parent 5fb6363 commit 4fd33ab
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/shadows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,17 @@ where
response.state.delta.clone(),
Some(false),
)?;
Ok(response.state.delta)
} else if let Some(_) = response.state.reported {

Check warning on line 238 in src/shadows/mod.rs

View workflow job for this annotation

GitHub Actions / clippy

redundant pattern matching, consider using `is_some()`

warning: redundant pattern matching, consider using `is_some()` --> src/shadows/mod.rs:238:39 | 238 | } else if let Some(_) = response.state.reported { | -------^^^^^^^-------------------------- help: try this: `if response.state.reported.is_some()` | = note: this will change drop order of the result, as well as all temporaries = note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
self.handler.change_shadow_value(
&mut state,
response.state.reported,
None,
response.state.reported.clone(),
Some(false),
)?;
Ok(response.state.reported)
} else {
Ok(None)
}
Ok(response.state.delta)
})?
}
Topic::GetRejected | Topic::UpdateRejected => {
Expand Down

0 comments on commit 4fd33ab

Please sign in to comment.