diff --git a/src/driver.rs b/src/driver.rs index 52c896c2..c6c1715d 100644 --- a/src/driver.rs +++ b/src/driver.rs @@ -1,6 +1,7 @@ //! The `Storage`, `Read`, `Write` and `Seek` driver. #![allow(non_camel_case_types)] +#[allow(deprecated)] use generic_array::ArrayLength; use crate::io::Result; @@ -46,9 +47,11 @@ pub trait Storage { /// littlefs uses a read cache, a write cache, and one cache per per file. /// Must be a multiple of `READ_SIZE` and `WRITE_SIZE`. /// Must be a factor of `BLOCK_SIZE`. + #[allow(deprecated)] type CACHE_SIZE: ArrayLength; /// Size of the lookahead buffer used by littlefs, measured in multiples of 8 bytes. + #[allow(deprecated)] type LOOKAHEAD_SIZE: ArrayLength; ///// Maximum length of a filename plus one. Stored in superblock. diff --git a/src/fs.rs b/src/fs.rs index 2c4af7a3..5ecbd60f 100644 --- a/src/fs.rs +++ b/src/fs.rs @@ -11,6 +11,7 @@ use generic_array::typenum::marker_traits::Unsigned; use littlefs2_sys as ll; // so far, don't need `heapless-bytes`. +#[allow(deprecated)] pub type Bytes = generic_array::GenericArray; pub use littlefs2_core::{Attribute, DirEntry, FileOpenFlags, FileType, Metadata}; @@ -47,6 +48,7 @@ struct Cache { read: UnsafeCell>, write: UnsafeCell>, // lookahead: aligned::Aligned>, + #[allow(deprecated)] lookahead: UnsafeCell>, } @@ -118,17 +120,9 @@ impl Allocation { debug_assert!(cache_size > 0); debug_assert!(lookahead_size > 0); - // cache must be multiple of read - debug_assert!(read_size <= cache_size); - debug_assert!(cache_size % read_size == 0); - - // cache must be multiple of write - debug_assert!(write_size <= cache_size); - debug_assert!(cache_size % write_size == 0); - - // block must be multiple of cache - debug_assert!(cache_size <= block_size); - debug_assert!(block_size % cache_size == 0); + debug_assert!(cache_size.is_multiple_of(read_size)); + debug_assert!(cache_size.is_multiple_of(write_size)); + debug_assert!(block_size.is_multiple_of(cache_size)); let cache = Cache::new();