Skip to content

Commit

Permalink
Display launch address using 'SocketAddr' fmt.
Browse files Browse the repository at this point in the history
This fixes IPv6 address display and future-proofs any such display.
  • Loading branch information
breard-r authored and SergioBenitez committed Aug 25, 2021
1 parent dd43d68 commit 7a54a12
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/lib/src/rocket.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::fmt;
use std::ops::{Deref, DerefMut};
use std::convert::TryInto;
use std::net::SocketAddr;

use yansi::Paint;
use either::Either;
Expand Down Expand Up @@ -626,7 +627,8 @@ impl Rocket<Ignite> {
rkt.fairings.handle_liftoff(&rkt).await;

let proto = rkt.config.tls_enabled().then(|| "https").unwrap_or("http");
let addr = format!("{}://{}:{}", proto, rkt.config.address, rkt.config.port);
let socket_addr = SocketAddr::new(rkt.config.address, rkt.config.port);
let addr = format!("{}://{}", proto, socket_addr);
launch_info!("{}{} {}",
Paint::emoji("🚀 "),
Paint::default("Rocket has launched from").bold(),
Expand Down

0 comments on commit 7a54a12

Please sign in to comment.