From d5e2162f526e91a8b7bb224d82a79850c5c288d5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 8 Nov 2024 17:11:00 +0100 Subject: [PATCH] test fixes --- .github/workflows/ci.yml | 2 +- src/filestore.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1fe60c..dec7e0b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@1.75.0 + - uses: dtolnay/rust-toolchain@1.81.0 - run: cargo check --release cross-check: diff --git a/src/filestore.rs b/src/filestore.rs index 7709c9c..12fd848 100644 --- a/src/filestore.rs +++ b/src/filestore.rs @@ -4,8 +4,7 @@ use spacepackets::ByteConversionError; pub use std_mod::*; #[derive(Debug, thiserror::Error)] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] +#[cfg_attr(all(feature = "defmt", not(feature = "std")), derive(defmt::Format))] #[non_exhaustive] pub enum FilestoreError { #[error("file does not exist")] @@ -121,7 +120,8 @@ pub mod std_mod { use super::*; use std::{ fs::{self, File, OpenOptions}, - io::{BufReader, Read, Seek, SeekFrom, Write}, path::Path, + io::{BufReader, Read, Seek, SeekFrom, Write}, + path::Path, }; #[derive(Default)] @@ -642,7 +642,7 @@ mod tests { } assert_eq!( error.to_string(), - format!("filestore error: {}", byte_conv_error) + format!("byte conversion: {}", byte_conv_error) ); } else { panic!("unexpected error"); @@ -765,7 +765,7 @@ mod tests { if let FilestoreError::ChecksumTypeNotImplemented(cksum_type) = error { assert_eq!( error.to_string(), - format!("checksum {:?} not implemented", cksum_type) + format!("checksum type not implemented: {:?}", cksum_type) ); } else { panic!("unexpected error");