From 533afc33faaab9cfe73aa540cbfd8e7ccd1e04d0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 13 Apr 2024 12:10:32 +0200 Subject: [PATCH 1/2] moved CCSDS constant --- CHANGELOG.md | 4 ++++ src/ecss/mod.rs | 1 - src/lib.rs | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab883f8..e0b1370 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). # [unreleased] +## Changed + +- Moved `CCSDS_HEADER_LEN` constant to the crate root. + # [v0.11.0-rc.2] 2024-04-04 ## Changed diff --git a/src/ecss/mod.rs b/src/ecss/mod.rs index ad84a81..37345f3 100644 --- a/src/ecss/mod.rs +++ b/src/ecss/mod.rs @@ -22,7 +22,6 @@ pub mod tm; pub mod verification; pub type CrcType = u16; -pub const CCSDS_HEADER_LEN: usize = size_of::(); #[derive(Debug, Copy, Clone, Eq, PartialEq, IntoPrimitive, TryFromPrimitive)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] diff --git a/src/lib.rs b/src/lib.rs index be55af1..d7b6fcb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -65,7 +65,6 @@ extern crate alloc; #[cfg(any(feature = "std", test))] extern crate std; -use crate::ecss::CCSDS_HEADER_LEN; use core::{ fmt::{Debug, Display, Formatter}, hash::Hash, @@ -88,6 +87,8 @@ mod private { pub trait Sealed {} } +pub const CCSDS_HEADER_LEN: usize = core::mem::size_of::(); + /// CRC algorithm used by the PUS standard, the CCSDS TC standard and the CFDP standard. pub const CRC_CCITT_FALSE: Crc = Crc::::new(&CRC_16_IBM_3740); From 8972dcbfc0af89bf0518aa598e15e2bf1ceedb4c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 13 Apr 2024 17:39:53 +0200 Subject: [PATCH 2/2] bump MSRV --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index d4d9cd9..9624fd2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "spacepackets" version = "0.11.0-rc.2" edition = "2021" -rust-version = "1.61" +rust-version = "1.65" authors = ["Robin Mueller "] description = "Generic implementations for various CCSDS and ECSS packet standards" homepage = "https://egit.irs.uni-stuttgart.de/rust/spacepackets"