Skip to content

Commit

Permalink
fixed comp errors
Browse files Browse the repository at this point in the history
  • Loading branch information
SaHHiiLL committed Nov 23, 2023
1 parent 5ff449c commit cca839e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions chat_messages/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,16 @@ use serde::Serialize;
#[derive(serde::Deserialize, Debug, Serialize)]
pub struct Message {
message: String,
addr: SocketAddr,
}

impl Message {
pub fn new(message: String, addr: SocketAddr) -> Self {
Self { message, addr }
pub fn new(message: String) -> Self {
Self { message}
}

pub fn message(&self) -> &String {
&self.message
}

pub fn addr(&self) -> &SocketAddr {
&self.addr
}
}

0 comments on commit cca839e

Please sign in to comment.