chore: replace all #[snafu(display(...))] with regular doc comments ///

This commit is contained in:
J / Jacob Babich
2026-07-15 13:48:21 -04:00
parent 4eb8a752cc
commit a09a97d06d
4 changed files with 8 additions and 7 deletions

View File

@@ -41,9 +41,10 @@ impl From<MapKey> for Arbitrary {
#[derive(Debug, Snafu)] #[derive(Debug, Snafu)]
pub enum MapKeyFromArbitraryError { 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 }, 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 }, MapCannotBeAMapKey { value: Map },
} }

View File

@@ -4,8 +4,8 @@ use snafu::Snafu;
#[derive(Debug, Clone, derive_more::Into)] #[derive(Debug, Clone, derive_more::Into)]
pub struct FiniteF64(f64); pub struct FiniteF64(f64);
/// {value:?} is not finite
#[derive(Debug, Snafu)] #[derive(Debug, Snafu)]
#[snafu(display("{value:?} is not finite"))]
pub struct NotFinite { pub struct NotFinite {
value: f64, value: f64,
} }

View File

@@ -12,13 +12,13 @@ pub struct EntityId(pub Domain, pub ObjectId);
#[derive(Debug, Clone, Snafu)] #[derive(Debug, Clone, Snafu)]
pub enum EntityIdParsingError { 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, 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: <Domain as FromStr>::Err }, ParsingDomain { source: <Domain as FromStr>::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 }, ParsingObjectId { source: ObjectIdParsingError },
} }

View File

@@ -7,8 +7,8 @@ use snafu::Snafu;
#[derive(Debug, Clone, derive_more::Display, FromPyFromStr, ToStrToPy)] #[derive(Debug, Clone, derive_more::Display, FromPyFromStr, ToStrToPy)]
pub struct Slug(Arc<str>); pub struct Slug(Arc<str>);
/// 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)] #[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 { pub struct SlugParsingError {
encountered: char, encountered: char,
} }