From f514e9f50c685cf46c7c5055a1eba3e40c165f39 Mon Sep 17 00:00:00 2001 From: Jake McGinty Date: Sun, 6 May 2018 18:57:52 -0700 Subject: global: small aesthetic cleanup --- src/message.rs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'src/message.rs') diff --git a/src/message.rs b/src/message.rs index 32445f6..4dd2fa8 100644 --- a/src/message.rs +++ b/src/message.rs @@ -4,6 +4,11 @@ use failure::Error; use std::convert::{TryFrom, TryInto}; use byteorder::{ByteOrder, LittleEndian}; +#[derive(Deref)] pub struct Initiation(Vec); +#[derive(Deref)] pub struct Response(Vec); +#[derive(Deref)] pub struct CookieReply(Vec); +#[derive(Deref)] pub struct Transport(Vec); + pub enum Message { Initiation(Initiation), Response(Response), @@ -25,9 +30,6 @@ impl TryFrom> for Message { } } -#[derive(Deref)] -pub struct Initiation(Vec); - impl Initiation { pub fn their_index(&self) -> u32 { LittleEndian::read_u32(&self[4..]) @@ -51,9 +53,6 @@ impl TryFrom> for Initiation { } } -#[derive(Deref)] -pub struct Response(Vec); - impl Response { pub fn their_index(&self) -> u32 { LittleEndian::read_u32(&self[4..]) @@ -89,9 +88,6 @@ impl TryFrom> for Response { } } -#[derive(Deref)] -pub struct CookieReply(Vec); - impl CookieReply { pub fn our_index(&self) -> u32 { LittleEndian::read_u32(&self[4..]) @@ -123,9 +119,6 @@ impl TryFrom> for CookieReply { } } -#[derive(Deref)] -pub struct Transport(Vec); - impl Transport { pub fn our_index(&self) -> u32 { LittleEndian::read_u32(&self[4..]) -- cgit v1.2.3-59-g8ed1b