Skip to content

Commit df5468f

Browse files
committed
fix: use alloc::format in invalid_data_error macro and improve formatting
1 parent 1774402 commit df5468f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ macro_rules! invalid_data_error {
1212
::core2::io::Error::new(::core2::io::ErrorKind::InvalidData, $fmt)
1313
};
1414
($fmt:expr, $($arg:tt)*) => {
15-
::core2::io::Error::new(::core2::io::ErrorKind::InvalidData, format!($fmt, $($arg)*))
15+
::core2::io::Error::new(
16+
::core2::io::ErrorKind::InvalidData,
17+
::alloc::format!($fmt, $($arg)*),
18+
)
1619
};
1720
}
1821

0 commit comments

Comments
 (0)