mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-24 00:00:16 +02:00
Make clippy happy (#3350)
This commit is contained in:
@@ -85,19 +85,19 @@ mod tests {
|
||||
async fn spawn_app(host: impl Into<String>) -> String {
|
||||
let host = host.into();
|
||||
// Bind to localhost at the port 0, which will let the OS assign an available port to us
|
||||
let listener = TcpListener::bind(format!("{}:0", host)).await.unwrap();
|
||||
let listener = TcpListener::bind(format!("{host}:0")).await.unwrap();
|
||||
// Retrieve the port assigned to us by the OS
|
||||
let port = listener.local_addr().unwrap().port();
|
||||
tokio::spawn(async {
|
||||
axum::serve(listener, app()).await.unwrap();
|
||||
});
|
||||
// Returns address (e.g. http://127.0.0.1{random_port})
|
||||
format!("http://{}:{}", host, port)
|
||||
format!("http://{host}:{port}")
|
||||
}
|
||||
let listening_url = spawn_app("127.0.0.1").await;
|
||||
|
||||
let mut event_stream = reqwest::Client::new()
|
||||
.get(format!("{}/sse", listening_url))
|
||||
.get(format!("{listening_url}/sse"))
|
||||
.header("User-Agent", "integration_test")
|
||||
.send()
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user