Drop the `Writeable::encode_with_len` method in non-test buidls
[rust-lightning] / lightning / src / util / ser.rs
index 8fb72a8f9fe643f56cfc259e5b7214b56a4fb761..de12d8506f8d2da87becade08ac82514e30dc6d0 100644 (file)
@@ -174,6 +174,7 @@ pub trait Writeable {
        }
 
        /// Writes self out to a Vec<u8>
+       #[cfg(test)]
        fn encode_with_len(&self) -> Vec<u8> {
                let mut msg = VecWriter(Vec::new());
                0u16.write(&mut msg).unwrap();
@@ -475,10 +476,9 @@ macro_rules! impl_array {
        );
 }
 
-//TODO: performance issue with [u8; size] with impl_array!()
 impl_array!(3); // for rgb
 impl_array!(4); // for IPv4
-impl_array!(10); // for OnionV2
+impl_array!(12); // for OnionV2
 impl_array!(16); // for IPv6
 impl_array!(32); // for channel id & hmac
 impl_array!(PUBLIC_KEY_SIZE); // for PublicKey