From 4aeb9b03149bb8775d1023ba1d0a14dc2c1f7a7d Mon Sep 17 00:00:00 2001 From: Dilshod Tadjibaev <939125+antimora@users.noreply.github.com> Date: Tue, 8 Oct 2024 13:13:50 -0500 Subject: [PATCH] Use core::error::Error for no-std --- crates/burn-core/src/config.rs | 4 +--- crates/burn-core/src/record/recorder.rs | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/crates/burn-core/src/config.rs b/crates/burn-core/src/config.rs index 94166228da..ddea88df77 100644 --- a/crates/burn-core/src/config.rs +++ b/crates/burn-core/src/config.rs @@ -28,9 +28,7 @@ impl core::fmt::Display for ConfigError { } } -// TODO: Move from std to core after Error is core (see https://github.com/rust-lang/rust/issues/103765) -#[cfg(feature = "std")] -impl std::error::Error for ConfigError {} +impl core::error::Error for ConfigError {} /// Configuration trait. pub trait Config: serde::Serialize + serde::de::DeserializeOwned { diff --git a/crates/burn-core/src/record/recorder.rs b/crates/burn-core/src/record/recorder.rs index d971763284..45081c8b9d 100644 --- a/crates/burn-core/src/record/recorder.rs +++ b/crates/burn-core/src/record/recorder.rs @@ -171,9 +171,7 @@ impl core::fmt::Display for RecorderError { } } -// TODO: Move from std to core after Error is core (see https://github.com/rust-lang/rust/issues/103765) -#[cfg(feature = "std")] -impl std::error::Error for RecorderError {} +impl core::error::Error for RecorderError {} pub(crate) fn bin_config() -> bincode::config::Configuration { bincode::config::standard()