Skip to content

Commit 3fda2fb

Browse files
committed
Missed a generic-array type
1 parent cdcb99f commit 3fda2fb

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "littlefs2"
33
description = "Idiomatic Rust API for littlefs"
4-
version = "0.3.0"
4+
version = "0.3.1"
55
authors = ["Nicolas Stalder <n@stalder.io>", "Brandon Edens <brandonedens@gmail.com>"]
66
edition = "2018"
77
license = "Apache-2.0 OR MIT"

src/driver.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ pub trait Storage {
6767
///// to the C backend.
6868
//type FILENAME_MAX_PLUS_ONE: ArrayLength<u8>;
6969

70-
/// Maximum length of a path plus one. Necessary to convert Rust string slices
71-
/// to C strings, which requires an allocation for the terminating
72-
/// zero-byte. If in doubt, set to `FILENAME_MAX_PLUS_ONE`.
73-
/// Must be larger than `FILENAME_MAX_PLUS_ONE`.
74-
type PATH_MAX_PLUS_ONE: ArrayLength<u8>;
70+
// /// Maximum length of a path plus one. Necessary to convert Rust string slices
71+
// /// to C strings, which requires an allocation for the terminating
72+
// /// zero-byte. If in doubt, set to `FILENAME_MAX_PLUS_ONE`.
73+
// /// Must be larger than `FILENAME_MAX_PLUS_ONE`.
74+
// type PATH_MAX_PLUS_ONE: ArrayLength<u8>;
7575

7676
///// Maximum size of file. Stored in superblock.
7777
///// Defaults to 2_147_483_647 (or u31, to avoid sign issues in the C code).
@@ -136,8 +136,6 @@ mod future {
136136
// TODO: this supposedly influences whether files are inlined or not. Clarify
137137
type CACHE_SIZE;
138138
type LOOKAHEADWORDS_SIZE;
139-
// not part of littlefs
140-
type PATH_MAX_PLUS_ONE;
141139
}
142140

143141
pub trait RuntimeParameters {

src/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl<Storage: driver::Storage> Allocation<Storage> {
9696
debug_assert!(filename_max_plus_one <= 1_022+1);
9797
// limitation of ll-bindings
9898
debug_assert!(filename_max_plus_one == 255+1);
99-
let path_max_plus_one: u32 = <Storage as driver::Storage>::PATH_MAX_PLUS_ONE::to_u32();
99+
let path_max_plus_one: u32 = crate::consts::PATH_MAX_PLUS_ONE as _;
100100
// TODO: any upper limit?
101101
debug_assert!(path_max_plus_one >= filename_max_plus_one);
102102
let file_max = crate::consts::FILEBYTES_MAX;

src/macros.rs

-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ macro_rules! ram_storage { (
5050
const BLOCK_SIZE: usize = $block_size;
5151
const BLOCK_COUNT: usize = $block_count;
5252
type LOOKAHEADWORDS_SIZE = $lookaheadwords_size;
53-
type PATH_MAX_PLUS_ONE = $path_max_plus_one;
5453

5554
fn read(&self, offset: usize, buf: &mut [u8]) -> $Result<usize> {
5655
let read_size: usize = Self::READ_SIZE;
@@ -180,7 +179,6 @@ macro_rules! const_ram_storage { (
180179
const BLOCK_SIZE: usize = $block_size;
181180
const BLOCK_COUNT: usize = $block_count;
182181
type LOOKAHEADWORDS_SIZE = $lookaheadwords_size;
183-
type PATH_MAX_PLUS_ONE = $path_max_plus_one;
184182

185183
fn read(&self, offset: usize, buf: &mut [u8]) -> $Result<usize> {
186184
let read_size: usize = Self::READ_SIZE;

0 commit comments

Comments
 (0)