fmt
All checks were successful
Rust/spacepackets/pipeline/head This commit looks good
Rust/spacepackets/pipeline/pr-main This commit looks good

This commit is contained in:
Robin Müller 2023-08-16 18:19:41 +02:00
parent 6ab05e2d83
commit 9a52066314
Signed by: muellerr
GPG Key ID: A649FB78196E3849
2 changed files with 4 additions and 8 deletions

View File

@ -269,10 +269,7 @@ impl<'data> TryFrom<Tlv<'data>> for EntityIdTlv {
}
}
let len_value = value.value().len();
if len_value != 1
&& len_value != 2
&& len_value != 4
&& len_value != 8 {
if len_value != 1 && len_value != 2 && len_value != 4 && len_value != 8 {
return Err(TlvLvError::InvalidValueLength(len_value));
}
Ok(Self::new(

View File

@ -1,7 +1,7 @@
//! Abstractions for the Message to User CFDP TLV subtype.
use delegate::delegate;
use super::{Tlv, TlvLvError, TlvType, TlvTypeField};
use crate::ByteConversionError;
use super::{TlvLvError, Tlv, TlvType, TlvTypeField};
use delegate::delegate;
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct MsgToUserTlv<'data> {
@ -9,11 +9,10 @@ pub struct MsgToUserTlv<'data> {
}
impl<'data> MsgToUserTlv<'data> {
/// Create a new message to user TLV where the type field is set correctly.
pub fn new(value: &'data [u8]) -> Result<MsgToUserTlv<'data>, TlvLvError> {
Ok(Self {
tlv: Tlv::new(TlvType::MsgToUser, value)?
tlv: Tlv::new(TlvType::MsgToUser, value)?,
})
}