diff --git a/src/packet/builder.rs b/src/packet/builder.rs index 25c7cf8..9aa9310 100644 --- a/src/packet/builder.rs +++ b/src/packet/builder.rs @@ -28,9 +28,9 @@ impl<'a> SphinxPacketBuilder<'a> { self } - pub fn build_packet( + pub fn build_packet>( &self, - message: Vec, + message: M, route: &[Node], destination: &Destination, delays: &[Delay], @@ -41,7 +41,8 @@ impl<'a> SphinxPacketBuilder<'a> { }; // no need to check if plaintext has correct length as this check is already performed in payload encapsulation - let payload = Payload::encapsulate_message(&message, &payload_keys, self.payload_size)?; + let payload = + Payload::encapsulate_message(message.as_ref(), &payload_keys, self.payload_size)?; Ok(SphinxPacket { header, payload }) } }