Skip to content

Commit 8c5f264

Browse files
committed
move shared code for blocking & async to new module
1 parent df4227b commit 8c5f264

File tree

10 files changed

+14
-7
lines changed

10 files changed

+14
-7
lines changed
File renamed without changes.

src/common/filesystem/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pub(crate) mod attributes;
2+
pub(crate) mod cluster;
3+
pub(crate) mod timestamp;

src/common/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
//! Common modules that have no difference between blocking and asynchronous code
2+
3+
pub(crate) mod filesystem;
4+
pub(crate) mod sdcard;

src/common/sdcard/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub mod proto;
File renamed without changes.

src/inner/filesystem/mod.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,18 @@
66
/// Maximum file size supported by this library
77
pub const MAX_FILE_SIZE: u32 = u32::MAX;
88

9-
mod attributes;
10-
mod cluster;
119
mod directory;
1210
mod filename;
1311
mod files;
1412
mod handles;
15-
mod timestamp;
1613

17-
pub use self::attributes::Attributes;
18-
pub use self::cluster::ClusterId;
14+
pub use crate::common::filesystem::attributes::Attributes;
15+
pub use crate::common::filesystem::cluster::ClusterId;
1916
pub use self::directory::{DirEntry, Directory, RawDirectory};
2017
pub use self::filename::{FilenameError, LfnBuffer, ShortFileName, ToShortFileName};
2118
pub use self::files::{File, FileError, Mode, RawFile};
2219
pub use self::handles::{Handle, HandleGenerator};
23-
pub use self::timestamp::{TimeSource, Timestamp};
20+
pub use crate::common::filesystem::timestamp::{TimeSource, Timestamp};
2421

2522
pub(crate) use self::directory::DirectoryInfo;
2623
pub(crate) use self::files::FileInfo;

src/inner/sdcard/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! This is currently optimised for readability and debugability, not
44
//! performance.
55
6-
pub mod proto;
6+
pub use crate::common::sdcard::proto;
77

88
use super::super::{bisync, DelayNs, SpiDevice};
99

src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ extern crate hex_literal;
8686
#[macro_use]
8787
mod structure;
8888

89+
mod common;
90+
8991
/// Blocking implementation of this crate. Uses traits from embedded_hal & embedded_io crates.
9092
#[path = "."]
9193
pub mod blocking {

0 commit comments

Comments
 (0)