diff --git a/src/array_string.rs b/src/array_string.rs index a94c3f7..48139b2 100644 --- a/src/array_string.rs +++ b/src/array_string.rs @@ -594,3 +594,17 @@ where Ok(v) } } + +impl<'a, A> TryFrom> for ArrayString +where + A: Array + Copy +{ + type Error = CapacityError; + + fn try_from(f: fmt::Arguments<'a>) -> Result { + use fmt::Write; + let mut v = Self::new(); + v.write_fmt(f).map_err(|e| CapacityError::new(e))?; + Ok(v) + } +}