rm unused var
This commit is contained in:
@@ -60,7 +60,6 @@ struct Listener {
|
|||||||
/// complete, all clones of the `Sender` are also dropped. This results in
|
/// complete, all clones of the `Sender` are also dropped. This results in
|
||||||
/// `shutdown_complete_rx.recv()` completing with `None`. At this point, it
|
/// `shutdown_complete_rx.recv()` completing with `None`. At this point, it
|
||||||
/// is safe to exit the server process.
|
/// is safe to exit the server process.
|
||||||
shutdown_complete_rx: mpsc::Receiver<()>,
|
|
||||||
shutdown_complete_tx: mpsc::Sender<()>,
|
shutdown_complete_tx: mpsc::Sender<()>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,7 +127,7 @@ pub async fn run(listener: TcpListener, shutdown: impl Future) {
|
|||||||
// a receiver is needed, the subscribe() method on the sender is used to create
|
// a receiver is needed, the subscribe() method on the sender is used to create
|
||||||
// one.
|
// one.
|
||||||
let (notify_shutdown, _) = broadcast::channel(1);
|
let (notify_shutdown, _) = broadcast::channel(1);
|
||||||
let (shutdown_complete_tx, shutdown_complete_rx) = mpsc::channel(1);
|
let (shutdown_complete_tx, mut shutdown_complete_rx) = mpsc::channel(1);
|
||||||
|
|
||||||
// Initialize the listener state
|
// Initialize the listener state
|
||||||
let mut server = Listener {
|
let mut server = Listener {
|
||||||
@@ -137,7 +136,6 @@ pub async fn run(listener: TcpListener, shutdown: impl Future) {
|
|||||||
limit_connections: Arc::new(Semaphore::new(MAX_CONNECTIONS)),
|
limit_connections: Arc::new(Semaphore::new(MAX_CONNECTIONS)),
|
||||||
notify_shutdown,
|
notify_shutdown,
|
||||||
shutdown_complete_tx,
|
shutdown_complete_tx,
|
||||||
shutdown_complete_rx,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Concurrently run the server and listen for the `shutdown` signal. The
|
// Concurrently run the server and listen for the `shutdown` signal. The
|
||||||
@@ -181,7 +179,6 @@ pub async fn run(listener: TcpListener, shutdown: impl Future) {
|
|||||||
// explicitly drop `shutdown_transmitter`. This is important, as the
|
// explicitly drop `shutdown_transmitter`. This is important, as the
|
||||||
// `.await` below would otherwise never complete.
|
// `.await` below would otherwise never complete.
|
||||||
let Listener {
|
let Listener {
|
||||||
mut shutdown_complete_rx,
|
|
||||||
shutdown_complete_tx,
|
shutdown_complete_tx,
|
||||||
notify_shutdown,
|
notify_shutdown,
|
||||||
..
|
..
|
||||||
|
|||||||
Reference in New Issue
Block a user