Skip to content

Commit

Permalink
Merge pull request #29 from quartiq/main
Browse files Browse the repository at this point in the history
impl core::error::Error for Error
  • Loading branch information
thejpster authored Oct 2, 2024
2 parents ac34f7c + 2fe6c19 commit 5b92046
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

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

### Added

* `impl core::error::Error for Error` on rust >= 1.81

## [v0.6.0] - 2024-08-30

### Changed
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ readme = "README.md"
[dependencies]
embedded-io = "0.6.1"
noline = { version = "0.5.0", optional = true }
rustversion = "1.0.17"

[features]
default = ["echo"]
Expand Down
9 changes: 9 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,15 @@ pub enum Error {
NotFound,
}

impl core::fmt::Display for Error {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
core::fmt::Debug::fmt(self, f)
}
}

#[rustversion::since(1.81)]
impl core::error::Error for Error {}

/// Looks for the named parameter in the parameter list of the item, then
/// finds the correct argument.
///
Expand Down

0 comments on commit 5b92046

Please sign in to comment.