all clippy 1.67 fixes

This commit is contained in:
2023-01-26 23:31:09 +01:00
parent 81ba7c7e79
commit 4e361e4421
6 changed files with 38 additions and 55 deletions

View File

@ -153,10 +153,10 @@ impl Display for StoreIdError {
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
match self {
StoreIdError::InvalidSubpool(pool) => {
write!(f, "invalid subpool, index: {}", pool)
write!(f, "invalid subpool, index: {pool}")
}
StoreIdError::InvalidPacketIdx(packet_idx) => {
write!(f, "invalid packet index: {}", packet_idx)
write!(f, "invalid packet index: {packet_idx}")
}
}
}
@ -183,19 +183,19 @@ impl Display for StoreError {
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
match self {
StoreError::DataTooLarge(size) => {
write!(f, "data to store with size {} is too large", size)
write!(f, "data to store with size {size} is too large")
}
StoreError::StoreFull(u16) => {
write!(f, "store is too full. index for full subpool: {}", u16)
write!(f, "store is too full. index for full subpool: {u16}")
}
StoreError::InvalidStoreId(id_e, addr) => {
write!(f, "invalid store ID: {}, address: {:?}", id_e, addr)
write!(f, "invalid store ID: {id_e}, address: {addr:?}")
}
StoreError::DataDoesNotExist(addr) => {
write!(f, "no data exists at address {:?}", addr)
write!(f, "no data exists at address {addr:?}")
}
StoreError::InternalError(e) => {
write!(f, "internal error: {}", e)
write!(f, "internal error: {e}")
}
}
}
@ -330,14 +330,12 @@ impl LocalPool {
fn write(&mut self, addr: &StoreAddr, data: &[u8]) -> Result<(), StoreError> {
let packet_pos = self.raw_pos(addr).ok_or_else(|| {
StoreError::InternalError(format!(
"write: Error in raw_pos func with address {:?}",
addr
"write: Error in raw_pos func with address {addr:?}"
))
})?;
let subpool = self.pool.get_mut(addr.pool_idx as usize).ok_or_else(|| {
StoreError::InternalError(format!(
"write: Error retrieving pool slice with address {:?}",
addr
"write: Error retrieving pool slice with address {addr:?}"
))
})?;
let pool_slice = &mut subpool[packet_pos..packet_pos + data.len()];

View File

@ -522,9 +522,9 @@ impl VerificationReporterCore {
)
}
pub fn send_acceptance_success<'src_data, E>(
pub fn send_acceptance_success<E>(
&self,
mut sendable: VerificationSendable<'src_data, TcStateNone, VerifSuccess>,
mut sendable: VerificationSendable<'_, TcStateNone, VerifSuccess>,
seq_counter: &(impl SequenceCountProviderCore<u16> + ?Sized),
sender: &mut (impl EcssTmSenderCore<Error = E> + ?Sized),
) -> Result<VerificationToken<TcStateAccepted>, VerificationOrSendErrorWithToken<E, TcStateNone>>
@ -535,9 +535,9 @@ impl VerificationReporterCore {
Ok(sendable.send_success_acceptance_success(Some(seq_counter)))
}
pub fn send_acceptance_failure<'src_data, E>(
pub fn send_acceptance_failure<E>(
&self,
mut sendable: VerificationSendable<'src_data, TcStateNone, VerifFailure>,
mut sendable: VerificationSendable<'_, TcStateNone, VerifFailure>,
seq_counter: &(impl SequenceCountProviderCore<u16> + ?Sized),
sender: &mut (impl EcssTmSenderCore<Error = E> + ?Sized),
) -> Result<(), VerificationOrSendErrorWithToken<E, TcStateNone>> {
@ -591,9 +591,9 @@ impl VerificationReporterCore {
)
}
pub fn send_start_success<'src_data, E>(
pub fn send_start_success<E>(
&self,
mut sendable: VerificationSendable<'src_data, TcStateAccepted, VerifSuccess>,
mut sendable: VerificationSendable<'_, TcStateAccepted, VerifSuccess>,
seq_counter: &(impl SequenceCountProviderCore<u16> + ?Sized),
sender: &mut (impl EcssTmSenderCore<Error = E> + ?Sized),
) -> Result<
@ -630,9 +630,9 @@ impl VerificationReporterCore {
)
}
pub fn send_start_failure<'src_data, E>(
pub fn send_start_failure<E>(
&self,
mut sendable: VerificationSendable<'src_data, TcStateAccepted, VerifFailure>,
mut sendable: VerificationSendable<'_, TcStateAccepted, VerifFailure>,
seq_counter: &(impl SequenceCountProviderCore<u16> + ?Sized),
sender: &mut (impl EcssTmSenderCore<Error = E> + ?Sized),
) -> Result<(), VerificationOrSendErrorWithToken<E, TcStateAccepted>> {
@ -741,9 +741,9 @@ impl VerificationReporterCore {
)
}
pub fn send_step_or_completion_success<'src_data, E>(
pub fn send_step_or_completion_success<E>(
&self,
mut sendable: VerificationSendable<'src_data, TcStateStarted, VerifSuccess>,
mut sendable: VerificationSendable<'_, TcStateStarted, VerifSuccess>,
seq_counter: &(impl SequenceCountProviderCore<u16> + ?Sized),
sender: &mut (impl EcssTmSenderCore<Error = E> + ?Sized),
) -> Result<(), VerificationOrSendErrorWithToken<E, TcStateStarted>> {
@ -754,9 +754,9 @@ impl VerificationReporterCore {
Ok(())
}
pub fn send_step_or_completion_failure<'src_data, E>(
pub fn send_step_or_completion_failure<E>(
&self,
mut sendable: VerificationSendable<'src_data, TcStateStarted, VerifFailure>,
mut sendable: VerificationSendable<'_, TcStateStarted, VerifFailure>,
seq_counter: &(impl SequenceCountProviderCore<u16> + ?Sized),
sender: &mut (impl EcssTmSenderCore<Error = E> + ?Sized),
) -> Result<(), VerificationOrSendErrorWithToken<E, TcStateStarted>> {