From a3831b2e3953154ab6109b5ecffce5484922d890 Mon Sep 17 00:00:00 2001 From: embr Date: Mon, 31 Aug 2026 17:55:53 +0200 Subject: [PATCH] error: Optionally derive defmt::Format --- Cargo.toml | 2 ++ src/error.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index a99c116..eb376e5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,8 @@ rust-version = "1.85" default = ["std"] std = [] derive = ["dep:scroll_derive"] +defmt = ["dep:defmt"] [dependencies] +defmt = { version = "1.1.1", optional = true } scroll_derive = { version = "0.13", optional = true, path = "scroll_derive" } diff --git a/src/error.rs b/src/error.rs index ea58b82..9c7ddad 100644 --- a/src/error.rs +++ b/src/error.rs @@ -4,6 +4,7 @@ use core::{error, result}; use std::io; #[derive(Debug)] +#[cfg_attr(feature = "scroll", derive(defmt::Format))] /// A custom Scroll error pub enum Error { /// The type you tried to read was too big