Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeHahn committed Jun 7, 2024
1 parent da0deb1 commit e1113dd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion audio/src/fetch/receive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ use std::{

use bytes::Bytes;
use futures_util::StreamExt;
use http_body_util::BodyExt;
use hyper::StatusCode;
use tempfile::NamedTempFile;
use tokio::sync::{mpsc, oneshot};
use http_body_util::BodyExt;

use librespot_core::{http_client::HttpClient, session::Session, Error};

Expand Down
10 changes: 5 additions & 5 deletions core/src/http_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ use governor::{
};
use http::{header::HeaderValue, Uri};
use http_body_util::{BodyExt, Full};
use hyper::{
body::Incoming, header::USER_AGENT, HeaderMap, Request, Response, StatusCode
};
use hyper::{body::Incoming, header::USER_AGENT, HeaderMap, Request, Response, StatusCode};
use hyper_proxy2::{Intercept, Proxy, ProxyConnector};
use hyper_rustls::{HttpsConnector, HttpsConnectorBuilder};
use hyper_util::{client::legacy::{connect::HttpConnector, Client, ResponseFuture}, rt::TokioExecutor};
use hyper_util::{
client::legacy::{connect::HttpConnector, Client, ResponseFuture},
rt::TokioExecutor,
};
use nonzero_ext::nonzero;
use once_cell::sync::OnceCell;
use parking_lot::Mutex;
Expand Down Expand Up @@ -249,7 +250,6 @@ impl HttpClient {
))
})?;


Ok(self.hyper_client()?.request(req.map(Full::new)))
}

Expand Down
9 changes: 3 additions & 6 deletions discovery/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ use futures_core::Stream;
use futures_util::{FutureExt, TryFutureExt};
use hmac::{Hmac, Mac};
use http_body_util::{BodyExt, Full};
use hyper::{
body::Incoming, Method, Request, Response, StatusCode
};
use hyper::{body::Incoming, Method, Request, Response, StatusCode};

use hyper_util::{rt::TokioIo, server::graceful::GracefulShutdown};
use log::{debug, error, warn};
Expand Down Expand Up @@ -246,7 +244,7 @@ impl DiscoveryServer {
pub fn new(config: Config, port: &mut u16) -> Result<Self, Error> {
let (discovery, cred_rx) = RequestHandler::new(config);
let address = SocketAddr::new(Ipv4Addr::UNSPECIFIED.into(), *port);

let (close_tx, close_rx) = oneshot::channel();

let listener = match TcpListener::bind(address) {
Expand All @@ -271,10 +269,9 @@ impl DiscoveryServer {
}
}


tokio::spawn(async move {
let discovery = Arc::new(discovery);

let server = hyper::server::conn::http1::Builder::new();
let graceful = GracefulShutdown::new();
let mut close_rx = std::pin::pin!(close_rx);
Expand Down

0 comments on commit e1113dd

Please sign in to comment.