Skip to content

Commit 5b92046

Browse files
authored
Merge pull request #29 from quartiq/main
impl core::error::Error for Error
2 parents ac34f7c + 2fe6c19 commit 5b92046

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1111

1212
* For `Runner::input_byte` the buffer `B` does not need to be `Sized`
1313

14+
### Added
15+
16+
* `impl core::error::Error for Error` on rust >= 1.81
17+
1418
## [v0.6.0] - 2024-08-30
1519

1620
### Changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ readme = "README.md"
1111
[dependencies]
1212
embedded-io = "0.6.1"
1313
noline = { version = "0.5.0", optional = true }
14+
rustversion = "1.0.17"
1415

1516
[features]
1617
default = ["echo"]

src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,15 @@ pub enum Error {
127127
NotFound,
128128
}
129129

130+
impl core::fmt::Display for Error {
131+
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
132+
core::fmt::Debug::fmt(self, f)
133+
}
134+
}
135+
136+
#[rustversion::since(1.81)]
137+
impl core::error::Error for Error {}
138+
130139
/// Looks for the named parameter in the parameter list of the item, then
131140
/// finds the correct argument.
132141
///

0 commit comments

Comments
 (0)