We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e7d863f commit 5f6a2c5Copy full SHA for 5f6a2c5
src/message.rs
@@ -822,24 +822,12 @@ impl ToBytes for () {
822
}
823
824
825
-// Implement to_bytes for arrays - https://github.com/rust-lang/rfcs/issues/1038
826
-macro_rules! array_impls {
827
- ($($N:expr)+) => {
828
- $(
829
- impl ToBytes for [u8; $N] {
830
- fn to_bytes(&self) -> &[u8] { self }
831
- }
832
- )+
+impl<const N: usize> ToBytes for [u8; N] {
+ fn to_bytes(&self) -> &[u8] {
+ self
833
834
835
836
-array_impls! {
837
- 0 1 2 3 4 5 6 7 8 9
838
- 10 11 12 13 14 15 16 17 18 19
839
- 20 21 22 23 24 25 26 27 28 29
840
- 30 31 32
841
-}
842
-
843
#[cfg(test)]
844
mod test {
845
use super::*;
0 commit comments