From 17de167e99451616090b98dc8ed9330dcb2380c5 Mon Sep 17 00:00:00 2001 From: Oliver Rockstedt Date: Sun, 29 Mar 2026 12:11:14 +0200 Subject: [PATCH] Use error from core --- README.md | 4 ++++ src/error.rs | 5 +---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2a1698f..77c815c 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,10 @@ fn midi_to_bytes(message: wmidi::MidiMessage<'_>) -> Vec { ## Changelog +### Unreleased + +* Use `error` from `core`. + ### 4.0.0 * New ControlFunction type which simply wraps a U7. diff --git a/src/error.rs b/src/error.rs index 50704da..2cd5ef8 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,6 +1,5 @@ +use core::error; use core::fmt; -#[cfg(feature = "std")] -use std::error; /// Midi decoding errors. #[derive(Copy, Clone, Debug, Eq, PartialEq)] @@ -40,7 +39,6 @@ pub enum FromBytesError { U14OutOfRange, } -#[cfg(feature = "std")] impl error::Error for FromBytesError {} impl fmt::Display for FromBytesError { @@ -56,7 +54,6 @@ pub enum ToSliceError { BufferTooSmall, } -#[cfg(feature = "std")] impl error::Error for ToSliceError {} impl fmt::Display for ToSliceError {