Skip to content

Commit

Permalink
Merge pull request #27 from exprust/develop
Browse files Browse the repository at this point in the history
feature: simply addr format in tcp listener binding
  • Loading branch information
Ando authored Aug 23, 2023
2 parents ec9179d + 8f53f5f commit 7608cef
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ impl Server {
pub fn listen(&self, host: &str, port: u32) {
self.initialize();

let mut addr = String::new();

if params::is_empty(host, port) {
panic!("An error occured, parameters need to be not empty");
}
Expand All @@ -59,9 +57,7 @@ impl Server {
panic!("An error occured, parameters need to be valid local port");
}

addr.push_str(&host);
addr.push(':');
addr.push_str(&port.to_string());
let addr = format!("{}:{}", host, port);

let term = Arc::new(AtomicBool::new(false));

Expand Down

0 comments on commit 7608cef

Please sign in to comment.