Skip to content

Commit fbad743

Browse files
committed
Add optional defmt support.
1 parent 8a340f4 commit fbad743

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
include:
2020
# Test MSRV
21-
- rust: 1.59.0
21+
- rust: 1.60.0
2222
TARGET: x86_64-unknown-linux-gnu
2323

2424
# Test nightly but don't fail

Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,10 @@ documentation = "https://docs.rs/embedded-storage"
1313
readme = "README.md"
1414
keywords = ["storage"]
1515
categories = ["embedded", "hardware-support", "no-std"]
16+
17+
[dependencies]
18+
defmt = { version = "0.3.8", optional = true }
19+
20+
[features]
21+
default = []
22+
defmt = ["dep:defmt"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ These issues / PRs will be labeled as `proposal`s in the issue tracker.
3535

3636
## Minimum Supported Rust Version (MSRV)
3737

38-
This crate is guaranteed to compile on stable Rust 1.59.0 and up. It _might_
38+
This crate is guaranteed to compile on stable Rust 1.60.0 and up. It _might_
3939
compile with older versions but that may change in any new patch release.
4040

4141
## License

src/block.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ pub trait BlockDevice<const BLOCK_SIZE: usize = 512> {
3333

3434
/// The linear numeric address of a block (or sector).
3535
#[derive(Copy, Clone, Debug, Eq, Ord, PartialEq, PartialOrd)]
36+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
3637
pub struct BlockIdx(pub u64);
3738

3839
impl BlockIdx {
@@ -80,6 +81,7 @@ impl SubAssign<BlockCount> for BlockIdx {
8081
///
8182
/// This may be added to a [`BlockIdx`] to get another `BlockIdx`.
8283
#[derive(Copy, Clone, Debug, Eq, Ord, PartialEq, PartialOrd)]
84+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
8385
pub struct BlockCount(pub u64);
8486

8587
impl Add<BlockCount> for BlockCount {

0 commit comments

Comments
 (0)