Skip to content

Commit

Permalink
Ipv6 address encased in a bracket (#81)
Browse files Browse the repository at this point in the history
* Show correct ipv6 addr

* fix indent

* remove needless borrow on ip variable
  • Loading branch information
vinian authored Dec 10, 2023
1 parent 46dc108 commit caecbde
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,11 @@ fn main() {
let printer = Printer::new();
let color_blue = Some(build_spec(Some(Color::Blue), false));
let color_red = Some(build_spec(Some(Color::Red), false));
let addr = format!("{}:{}", ip, port);
let addr = if IpAddr::from_str(ip).unwrap().is_ipv4() {
format!("{}:{}", ip, port)
} else {
format!("[{}]:{}", ip, port)
};
let compression_exts = compress
.clone()
.unwrap_or_default()
Expand Down

0 comments on commit caecbde

Please sign in to comment.