Skip to content

Commit

Permalink
fix more beta lints
Browse files Browse the repository at this point in the history
  • Loading branch information
jadamcrain committed Mar 31, 2024
1 parent 020f14b commit ec40239
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 68 deletions.
67 changes: 0 additions & 67 deletions dnp3/src/outstation/traits.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
use crate::app::attr::Attribute;
use crate::app::parse::count::CountSequence;
use crate::app::parse::prefix::Prefix;
use crate::app::parse::traits::{FixedSizeVariation, Index};
use crate::app::variations::Group50Var2;
use crate::app::RequestHeader;
use crate::app::Sequence;
Expand Down Expand Up @@ -550,67 +547,3 @@ impl ControlSupport<Group41Var4> for DefaultControlHandler {
self.status
}
}

trait HasCommandStatus {
fn status(&self) -> CommandStatus;
fn with_status(&self, status: CommandStatus) -> Self;
}

trait ControlSupportExt<T>: ControlSupport<T>
where
T: FixedSizeVariation + HasCommandStatus,
{
fn operate<I, F>(
&mut self,
seq: CountSequence<Prefix<I, T>>,
op_type: OperateType,
database: &mut DatabaseHandle,
mut func: F,
) where
F: FnMut(T, I),
I: Index,
{
for item in seq.iter() {
let status = {
if item.value.status() == CommandStatus::Success {
ControlSupport::<T>::operate(
self,
item.value,
item.index.widen_to_u16(),
op_type,
database,
)
} else {
CommandStatus::FormatError
}
};
func(item.value.with_status(status), item.index)
}
}

fn select<I, F>(
&mut self,
seq: CountSequence<Prefix<I, T>>,
database: &mut DatabaseHandle,
mut func: F,
) where
F: FnMut(T, I),
I: Index,
{
for item in seq.iter() {
let status = {
if item.value.status() == CommandStatus::Success {
ControlSupport::<T>::select(
self,
item.value,
item.index.widen_to_u16(),
database,
)
} else {
CommandStatus::FormatError
}
};
func(item.value.with_status(status), item.index)
}
}
}
1 change: 0 additions & 1 deletion ffi/dnp3-ffi/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use crate::attr::FfiAttrValue;
use dnp3::app::attr::*;
use dnp3::app::measurement::*;
use dnp3::app::*;
use dnp3::app::{ResponseFunction, ResponseHeader};
use dnp3::master::{
AssociationHandler, AssociationInformation, HeaderInfo, ReadHandler, ReadType, TaskError,
TaskType,
Expand Down

0 comments on commit ec40239

Please sign in to comment.