From a09a97d06d5a4f9051016512eda10a432f54bc48 Mon Sep 17 00:00:00 2001 From: J / Jacob Babich Date: Wed, 15 Jul 2026 13:48:21 -0400 Subject: [PATCH] chore: replace all `#[snafu(display(...))]` with regular doc comments `///` --- arbitrary-value/src/arbitrary.rs | 5 +++-- arbitrary-value/src/finite_f64.rs | 2 +- home-assistant/src/entity_id.rs | 6 +++--- home-assistant/src/slug.rs | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/arbitrary-value/src/arbitrary.rs b/arbitrary-value/src/arbitrary.rs index 7b85b0e..13150df 100644 --- a/arbitrary-value/src/arbitrary.rs +++ b/arbitrary-value/src/arbitrary.rs @@ -41,9 +41,10 @@ impl From for Arbitrary { #[derive(Debug, Snafu)] pub enum MapKeyFromArbitraryError { - #[snafu(display("floats aren't supported as map keys yet. got {value:?}"))] + /// floats aren't supported as map keys yet. got {value:?} FloatNotSupported { value: FiniteF64 }, - #[snafu(display("a map cannot be a map key. got {value:?}"))] + + /// a map cannot be a map key. got {value:?} MapCannotBeAMapKey { value: Map }, } diff --git a/arbitrary-value/src/finite_f64.rs b/arbitrary-value/src/finite_f64.rs index 8cce7b0..b438daa 100644 --- a/arbitrary-value/src/finite_f64.rs +++ b/arbitrary-value/src/finite_f64.rs @@ -4,8 +4,8 @@ use snafu::Snafu; #[derive(Debug, Clone, derive_more::Into)] pub struct FiniteF64(f64); +/// {value:?} is not finite #[derive(Debug, Snafu)] -#[snafu(display("{value:?} is not finite"))] pub struct NotFinite { value: f64, } diff --git a/home-assistant/src/entity_id.rs b/home-assistant/src/entity_id.rs index 787c377..9476ff1 100644 --- a/home-assistant/src/entity_id.rs +++ b/home-assistant/src/entity_id.rs @@ -12,13 +12,13 @@ pub struct EntityId(pub Domain, pub ObjectId); #[derive(Debug, Clone, Snafu)] pub enum EntityIdParsingError { - #[snafu(display("entity IDs have a dot / period in them, e.g. light.kitchen_lamp"))] + /// entity IDs have a dot / period in them, e.g. light.kitchen_lamp MissingDot, - #[snafu(display("could not parse the domain part of the entity ID"))] + /// could not parse the domain part of the entity ID ParsingDomain { source: ::Err }, - #[snafu(display("could not parse the object ID part of the entity ID"))] + /// could not parse the object ID part of the entity ID ParsingObjectId { source: ObjectIdParsingError }, } diff --git a/home-assistant/src/slug.rs b/home-assistant/src/slug.rs index baeee53..142f5ad 100644 --- a/home-assistant/src/slug.rs +++ b/home-assistant/src/slug.rs @@ -7,8 +7,8 @@ use snafu::Snafu; #[derive(Debug, Clone, derive_more::Display, FromPyFromStr, ToStrToPy)] pub struct Slug(Arc); +/// expected a lowercase ASCII alphabetical character (i.e. a through z) or a digit (i.e. 0 through 9) or an underscore (i.e. _) but encountered {encountered} #[derive(Debug, Clone, Snafu)] -#[snafu(display("expected a lowercase ASCII alphabetical character (i.e. a through z) or a digit (i.e. 0 through 9) or an underscore (i.e. _) but encountered {encountered}"))] pub struct SlugParsingError { encountered: char, }