diff --git a/candid_client/src/candid_connection.rs b/candid_client/src/candid_connection.rs index 5de593d..453cf35 100644 --- a/candid_client/src/candid_connection.rs +++ b/candid_client/src/candid_connection.rs @@ -1,7 +1,7 @@ use crate::Frame; use std::io::prelude::*; -use std::io::{BufReader, BufWriter, Lines}; +use std::io::{BufReader, BufWriter}; use std::net::{TcpStream, ToSocketAddrs}; use byteorder::{NetworkEndian, ReadBytesExt, WriteBytesExt}; diff --git a/candid_client/src/frame.rs b/candid_client/src/frame.rs index a4ecdb5..b13fc01 100644 --- a/candid_client/src/frame.rs +++ b/candid_client/src/frame.rs @@ -1,5 +1,5 @@ /// Represents a basic CAN Frame containing the frame's id and data -#[derive(Debug)] +#[derive(Debug, Copy, Clone)] pub struct Frame { pub id: u32, pub data: [u8; 8], @@ -10,4 +10,8 @@ impl Frame { pub fn new(id: u32, data: [u8; 8]) -> Frame { Frame { id, data } } + + pub fn to_string(&self) -> String { + format!("{:?}", &self) + } }