From 25d4da290f48015fa6a06b6da8cf4ef1ceb147d5 Mon Sep 17 00:00:00 2001 From: Max Audron Date: Tue, 28 Sep 2021 18:05:48 +0200 Subject: convert Init struct's methods to builder style --- src/message/handshake/init.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/message/handshake/init.rs') diff --git a/src/message/handshake/init.rs b/src/message/handshake/init.rs index df1b29e..51514ff 100644 --- a/src/message/handshake/init.rs +++ b/src/message/handshake/init.rs @@ -15,12 +15,14 @@ impl Init { } } - pub fn compression(mut self, v: bool) { - self.compression = v + pub fn compression(mut self, v: bool) -> Self { + self.compression = v; + self } - pub fn tls(mut self, v: bool) { - self.tls = v + pub fn tls(mut self, v: bool) -> Self { + self.tls = v; + self } pub fn serialize(self) -> Vec { -- cgit v1.2.3