diff --git a/src/base/dimension.rs b/src/base/dimension.rs index ec70dc4c..dd87647d 100644 --- a/src/base/dimension.rs +++ b/src/base/dimension.rs @@ -211,6 +211,26 @@ pub trait DimName: Dim { fn dim() -> usize; } +#[cfg(feature = "serde-serialize-no-std")] +impl Serialize for Const { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + ().serialize(serializer) + } +} + +#[cfg(feature = "serde-serialize-no-std")] +impl<'de, const D: usize> Deserialize<'de> for Const { + fn deserialize(deserializer: Des) -> Result + where + Des: Deserializer<'de>, + { + <()>::deserialize(deserializer).map(|_| Const::) + } +} + pub trait ToConst { type Const: DimName; }