add use_self clippy lint (#8325)

This commit is contained in:
Thomas Coratger
2024-05-29 15:14:14 +02:00
committed by GitHub
parent 0cb5358fef
commit 19c529e8df
200 changed files with 1817 additions and 1954 deletions

View File

@ -560,7 +560,7 @@ impl TaskSpawner for TaskExecutor {
fn spawn_critical(&self, name: &'static str, fut: BoxFuture<'static, ()>) -> JoinHandle<()> {
self.metrics.inc_critical_tasks();
TaskExecutor::spawn_critical(self, name, fut)
Self::spawn_critical(self, name, fut)
}
fn spawn_blocking(&self, fut: BoxFuture<'static, ()>) -> JoinHandle<()> {
@ -572,7 +572,7 @@ impl TaskSpawner for TaskExecutor {
name: &'static str,
fut: BoxFuture<'static, ()>,
) -> JoinHandle<()> {
TaskExecutor::spawn_critical_blocking(self, name, fut)
Self::spawn_critical_blocking(self, name, fut)
}
}
@ -610,7 +610,7 @@ impl TaskSpawnerExt for TaskExecutor {
where
F: Future<Output = ()> + Send + 'static,
{
TaskExecutor::spawn_critical_with_graceful_shutdown_signal(self, name, f)
Self::spawn_critical_with_graceful_shutdown_signal(self, name, f)
}
fn spawn_with_graceful_shutdown_signal<F>(
@ -620,7 +620,7 @@ impl TaskSpawnerExt for TaskExecutor {
where
F: Future<Output = ()> + Send + 'static,
{
TaskExecutor::spawn_with_graceful_shutdown_signal(self, f)
Self::spawn_with_graceful_shutdown_signal(self, f)
}
}

View File

@ -42,7 +42,7 @@ impl fmt::Debug for IncCounterOnDrop {
impl IncCounterOnDrop {
/// Creates a new instance of `IncCounterOnDrop` with the given counter.
pub fn new(counter: Counter) -> Self {
IncCounterOnDrop(counter)
Self(counter)
}
}