Skip to content

Commit

Permalink
Merge pull request #19 from exprust/develop
Browse files Browse the repository at this point in the history
feature: check if valid port on server listening
  • Loading branch information
Ando authored Aug 20, 2023
2 parents 00b2d49 + 469a605 commit 3ff01d1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ pub mod server {
panic!("An error occured, parameters need to be valid local host");
}

if !Params::is_valid_port(port) {
panic!("An error occured, parameters need to be valid local port");
}

addr.push_str(&host);

Check warning on line 45 in src/lib.rs

View workflow job for this annotation

GitHub Actions / lint

this expression creates a reference which is immediately dereferenced by the compiler
addr.push(':');
addr.push_str(&port.to_string());
Expand Down

0 comments on commit 3ff01d1

Please sign in to comment.