This commit is contained in:
Caio
2020-12-10 13:54:10 -03:00
parent 6dccb480f7
commit cca663f806
+7
View File
@@ -686,3 +686,10 @@ fn test_extend_zst() {
assert_eq!(&array[..], &[Z; 5]); assert_eq!(&array[..], &[Z; 5]);
assert_eq!(array.len(), 5); assert_eq!(array.len(), 5);
} }
#[test]
fn test_try_from_argument() {
use core::convert::TryFrom;
let v = ArrayString::<[u8; 16]>::try_from(format_args!("Hello {}", 123)).unwrap();
assert_eq!(&v, "Hello 123");
}