From 6c7ecfb694acf607868c4567285902d0c5013289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Tue, 1 Oct 2024 12:34:44 +0200 Subject: [PATCH] impl core::error::Error for Error --- CHANGELOG.md | 4 ++++ Cargo.toml | 1 + src/lib.rs | 8 ++++++++ 3 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3fbcb2c..32952f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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` + ## [v0.6.0] - 2024-08-30 ### Changed diff --git a/Cargo.toml b/Cargo.toml index 38465b3..9e4ae68 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,7 @@ license = "MIT OR Apache-2.0" edition = "2021" repository = "https://github.com/rust-embedded-community/menu" readme = "README.md" +rust-version = "1.81.0" [dependencies] embedded-io = "0.6.1" diff --git a/src/lib.rs b/src/lib.rs index 00159c4..cdaeff4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -127,6 +127,14 @@ 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) + } +} + +impl core::error::Error for Error {} + /// Looks for the named parameter in the parameter list of the item, then /// finds the correct argument. ///