Skip to content

Commit

Permalink
fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
jadamcrain committed May 4, 2024
1 parent a9593af commit 4d0bc9d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions dnp3/src/app/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -892,10 +892,7 @@ impl<'a> Iterator for VariationListIter<'a> {
let variation = *self.data.first()?;
let prop = *self.data.get(1)?;

self.data = match self.data.get(2..) {
Some(x) => x,
None => &[],
};
self.data = self.data.get(2..).unwrap_or_default();

Some(AttrItem {
variation,
Expand Down
2 changes: 1 addition & 1 deletion dnp3/src/outstation/database/details/event/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ impl EventBuffer {
.events
.iter()
.filter(|(_, e)| e.state.get() == EventState::Unselected && selector(e))
.take(limit.unwrap_or(usize::max_value()))
.take(limit.unwrap_or(usize::MAX))
{
evt.state.set(EventState::Selected);
count += 1;
Expand Down
2 changes: 1 addition & 1 deletion dnp3/src/outstation/database/details/event/write_fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ where
let difference: u64 = time.timestamp().raw_value() - cto.timestamp().raw_value();

// too big of a difference to encode
if difference > u16::max_value().into() {
if difference > u16::MAX.into() {
return Ok(Continue::NewHeader);
}

Expand Down

0 comments on commit 4d0bc9d

Please sign in to comment.