Skip to content

Commit 504efef

Browse files
committed
Fix upstream breakage in TLS example.
A breaking change in `tracing` (see tracing#3309) resulted in the TLS example breaking. This commit implements the work-around in the issue.
1 parent 4a410b7 commit 504efef

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

examples/tls/src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#[macro_use]
22
extern crate rocket;
3+
extern crate self as tracing;
34

45
#[cfg(test)]
56
mod tests;
67
mod redirector;
78

9+
use rocket::tracing::*;
810
use rocket::mtls::Certificate;
911
use rocket::listener::Endpoint;
1012

examples/tls/src/redirector.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
33
use std::net::SocketAddr;
44

5-
use rocket::http::uri::{Origin, Host};
6-
use rocket::tracing::{self, Instrument};
75
use rocket::{Rocket, Ignite, Orbit, State, Error};
6+
use rocket::http::uri::{Origin, Host};
7+
use rocket::tracing::Instrument;
88
use rocket::fairing::{Fairing, Info, Kind};
99
use rocket::response::Redirect;
1010
use rocket::listener::tcp::TcpListener;
@@ -39,7 +39,7 @@ impl Redirector {
3939
// Launch an instance of Rocket than handles redirection on `self.port`.
4040
pub async fn try_launch(self, config: Config) -> Result<Rocket<Ignite>, Error> {
4141
rocket::span_info!("HTTP -> HTTPS Redirector" => {
42-
info!(from = self.0, to = config.tls_addr.port(), "redirecting");
42+
info!(from = self.0, to = config.tls_addr.port(), "redirecting");
4343
});
4444

4545
let addr = SocketAddr::new(config.tls_addr.ip(), self.0);

0 commit comments

Comments
 (0)