a lot of clippy fixes
This commit is contained in:
@ -211,9 +211,9 @@ impl<E: 'static, Event: GenericEvent + Copy + 'static, AuxDataProvider: Clone +
|
||||
/// Create an event manager where the sender table will be the [DefaultSenderTableProvider]
|
||||
/// and the listener table will be the [DefaultListenerTableProvider].
|
||||
pub fn new(event_receiver: Box<dyn EventReceiver<Event, AuxDataProvider>>) -> Self {
|
||||
let listener_table = Box::new(DefaultListenerTableProvider::default());
|
||||
let sender_table =
|
||||
Box::new(DefaultSenderTableProvider::<E, Event, AuxDataProvider>::default());
|
||||
let listener_table: Box<DefaultListenerTableProvider> = Box::default();
|
||||
let sender_table: Box<DefaultSenderTableProvider<E, Event, AuxDataProvider>> =
|
||||
Box::default();
|
||||
Self::new_custom_tables(listener_table, sender_table, event_receiver)
|
||||
}
|
||||
}
|
||||
|
@ -136,17 +136,14 @@ impl<RAW: ToBeBytes, GID, UID> EventBase<RAW, GID, UID> {
|
||||
impl EventBase<u32, u16, u16> {
|
||||
#[inline]
|
||||
fn raw(&self) -> u32 {
|
||||
(((self.severity as u32) << 30) | ((self.group_id as u32) << 16) | self.unique_id as u32)
|
||||
as u32
|
||||
((self.severity as u32) << 30) | ((self.group_id as u32) << 16) | self.unique_id as u32
|
||||
}
|
||||
}
|
||||
|
||||
impl EventBase<u16, u8, u8> {
|
||||
#[inline]
|
||||
fn raw(&self) -> u16 {
|
||||
(((self.severity as u16) << 14) as u16
|
||||
| ((self.group_id as u16) << 8) as u16
|
||||
| self.unique_id as u16) as u16
|
||||
((self.severity as u16) << 14) | ((self.group_id as u16) << 8) | self.unique_id as u16
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@ impl StoreAddr {
|
||||
pub const INVALID_ADDR: u32 = 0xFFFFFFFF;
|
||||
|
||||
pub fn raw(&self) -> u32 {
|
||||
((self.pool_idx as u32) << 16) as u32 | self.packet_idx as u32
|
||||
((self.pool_idx as u32) << 16) | self.packet_idx as u32
|
||||
}
|
||||
}
|
||||
|
||||
@ -239,7 +239,7 @@ impl LocalPool {
|
||||
|
||||
fn validate_addr(&self, addr: &StoreAddr) -> Result<(), StoreError> {
|
||||
let pool_idx = addr.pool_idx as usize;
|
||||
if pool_idx as usize >= self.pool_cfg.cfg.len() {
|
||||
if pool_idx >= self.pool_cfg.cfg.len() {
|
||||
return Err(StoreError::InvalidStoreId(
|
||||
StoreIdError::InvalidSubpool(addr.pool_idx),
|
||||
Some(*addr),
|
||||
|
@ -569,7 +569,7 @@ impl VerificationReporterBasic {
|
||||
) -> Result<PusTm, EcssTmError<E>> {
|
||||
let mut source_data_len = size_of::<u32>();
|
||||
if let Some(step) = step {
|
||||
source_data_len += step.byte_width() as usize;
|
||||
source_data_len += step.byte_width();
|
||||
}
|
||||
source_buffer_large_enough(buf.len(), source_data_len)?;
|
||||
let mut idx = 0;
|
||||
@ -577,7 +577,7 @@ impl VerificationReporterBasic {
|
||||
idx += RequestId::SIZE_AS_BYTES;
|
||||
if let Some(step) = step {
|
||||
// Size check was done beforehand
|
||||
step.write_to_be_bytes(&mut buf[idx..idx + step.byte_width() as usize])
|
||||
step.write_to_be_bytes(&mut buf[idx..idx + step.byte_width()])
|
||||
.unwrap();
|
||||
}
|
||||
let mut sp_header = SpHeader::tm_unseg(self.apid(), 0, 0).unwrap();
|
||||
@ -601,10 +601,9 @@ impl VerificationReporterBasic {
|
||||
params: &'a FailParams,
|
||||
) -> Result<PusTm, EcssTmError<E>> {
|
||||
let mut idx = 0;
|
||||
let mut source_data_len =
|
||||
RequestId::SIZE_AS_BYTES + params.failure_code.byte_width() as usize;
|
||||
let mut source_data_len = RequestId::SIZE_AS_BYTES + params.failure_code.byte_width();
|
||||
if let Some(step) = step {
|
||||
source_data_len += step.byte_width() as usize;
|
||||
source_data_len += step.byte_width();
|
||||
}
|
||||
if let Some(failure_data) = params.failure_data {
|
||||
source_data_len += failure_data.len();
|
||||
@ -614,14 +613,14 @@ impl VerificationReporterBasic {
|
||||
idx += RequestId::SIZE_AS_BYTES;
|
||||
if let Some(step) = step {
|
||||
// Size check done beforehand
|
||||
step.write_to_be_bytes(&mut buf[idx..idx + step.byte_width() as usize])
|
||||
step.write_to_be_bytes(&mut buf[idx..idx + step.byte_width()])
|
||||
.unwrap();
|
||||
idx += step.byte_width() as usize;
|
||||
idx += step.byte_width();
|
||||
}
|
||||
params
|
||||
.failure_code
|
||||
.write_to_be_bytes(&mut buf[idx..idx + params.failure_code.byte_width() as usize])?;
|
||||
idx += params.failure_code.byte_width() as usize;
|
||||
.write_to_be_bytes(&mut buf[idx..idx + params.failure_code.byte_width()])?;
|
||||
idx += params.failure_code.byte_width();
|
||||
if let Some(failure_data) = params.failure_data {
|
||||
buf[idx..idx + failure_data.len()].copy_from_slice(failure_data);
|
||||
}
|
||||
@ -709,8 +708,8 @@ mod allocmod {
|
||||
source_data_buf: vec![
|
||||
0;
|
||||
RequestId::SIZE_AS_BYTES
|
||||
+ cfg.step_field_width as usize
|
||||
+ cfg.fail_code_field_width as usize
|
||||
+ cfg.step_field_width
|
||||
+ cfg.fail_code_field_width
|
||||
+ cfg.max_fail_data_len
|
||||
],
|
||||
seq_counter: cfg.seq_counter.clone(),
|
||||
|
Reference in New Issue
Block a user