mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-27 00:00:12 +02:00
chore: fix unused field warnings (#4151)
This commit is contained in:
@@ -10,7 +10,7 @@ use std::time::Duration;
|
|||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub(super) struct Sender {
|
pub(super) struct Sender {
|
||||||
tx: Arc<oneshot::Sender<()>>,
|
_tx: Arc<oneshot::Sender<()>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
@@ -20,7 +20,7 @@ pub(super) struct Receiver {
|
|||||||
|
|
||||||
pub(super) fn channel() -> (Sender, Receiver) {
|
pub(super) fn channel() -> (Sender, Receiver) {
|
||||||
let (tx, rx) = oneshot::channel();
|
let (tx, rx) = oneshot::channel();
|
||||||
let tx = Sender { tx: Arc::new(tx) };
|
let tx = Sender { _tx: Arc::new(tx) };
|
||||||
let rx = Receiver { rx };
|
let rx = Receiver { rx };
|
||||||
|
|
||||||
(tx, rx)
|
(tx, rx)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ use crate::runtime::{blocking, context, driver, Spawner};
|
|||||||
use crate::util::error::CONTEXT_MISSING_ERROR;
|
use crate::util::error::CONTEXT_MISSING_ERROR;
|
||||||
|
|
||||||
use std::future::Future;
|
use std::future::Future;
|
||||||
|
use std::marker::PhantomData;
|
||||||
use std::{error, fmt};
|
use std::{error, fmt};
|
||||||
|
|
||||||
/// Handle to the runtime.
|
/// Handle to the runtime.
|
||||||
@@ -41,8 +42,8 @@ pub struct Handle {
|
|||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
#[must_use = "Creating and dropping a guard does nothing"]
|
#[must_use = "Creating and dropping a guard does nothing"]
|
||||||
pub struct EnterGuard<'a> {
|
pub struct EnterGuard<'a> {
|
||||||
handle: &'a Handle,
|
_guard: context::EnterGuard,
|
||||||
guard: context::EnterGuard,
|
_handle_lifetime: PhantomData<&'a Handle>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Handle {
|
impl Handle {
|
||||||
@@ -55,8 +56,8 @@ impl Handle {
|
|||||||
/// [`tokio::spawn`]: fn@crate::spawn
|
/// [`tokio::spawn`]: fn@crate::spawn
|
||||||
pub fn enter(&self) -> EnterGuard<'_> {
|
pub fn enter(&self) -> EnterGuard<'_> {
|
||||||
EnterGuard {
|
EnterGuard {
|
||||||
handle: self,
|
_guard: context::enter(self.clone()),
|
||||||
guard: context::enter(self.clone()),
|
_handle_lifetime: PhantomData,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user