Skip to content

Commit f3a7b24

Browse files
committed
Add defmt::Format bound to error types in embedded-io
1 parent 2e19d4a commit f3a7b24

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

.github/workflows/clippy.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ jobs:
1414
- uses: dtolnay/rust-toolchain@stable
1515
with:
1616
components: clippy
17-
- run: cargo clippy --all-features -- --deny=warnings
17+
- run: cargo clippy --workspace --exclude=embedded-io-adapters --all-features -- --deny=warnings
18+
- run: cargo clippy --package=embedded-io-adapters --all-features -- --deny=warnings

.github/workflows/rustdoc.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ jobs:
1515
with:
1616
toolchain: nightly-2024-07-26
1717
# tokio/net required to workaround https://github.com/tokio-rs/tokio/issues/6165
18-
- run: RUSTDOCFLAGS="--deny=warnings --cfg=docsrs" cargo doc --all-features --features tokio/net
18+
- run: RUSTDOCFLAGS="--deny=warnings --cfg=docsrs" cargo doc --workspace --exclude=embedded-io-adapters --all-features --features tokio/net
19+
- run: RUSTDOCFLAGS="--deny=warnings --cfg=docsrs" cargo doc --package=embedded-io-adapters --all-features --features tokio/net

.github/workflows/test.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ jobs:
1717
- uses: actions/checkout@v4
1818
- uses: dtolnay/rust-toolchain@stable
1919
- run: cargo test --workspace
20-
20+
2121
test-all-features:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- uses: actions/checkout@v4
2525
- uses: dtolnay/rust-toolchain@stable
26-
- run: cargo test --workspace --all-features
26+
- run: cargo test --workspace --exclude=embedded-io-adapters --all-features
27+
- run: cargo test --package=embedded-io-adapters --all-features
2728

2829
build-nostd:
2930
runs-on: ubuntu-latest
@@ -43,4 +44,5 @@ jobs:
4344
steps:
4445
- uses: actions/checkout@v4
4546
- uses: dtolnay/[email protected]
46-
- run: cargo test --workspace --all-features
47+
- run: cargo test --workspace --exclude=embedded-io-adapters --all-features
48+
- run: cargo test --package=embedded-io-adapters --all-features

embedded-io/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ impl Error for std::io::Error {
218218
/// which might be different types.
219219
pub trait ErrorType {
220220
/// Error type of all the IO operations on this type.
221+
#[cfg(feature = "defmt")]
222+
type Error: Error + defmt::Format;
223+
/// Error type of all the IO operations on this type.
224+
#[cfg(not(feature = "defmt"))]
221225
type Error: Error;
222226
}
223227

0 commit comments

Comments
 (0)