Skip to content

Commit 15be6f1

Browse files
authored
Merge pull request kube-rs#1825 from imp/imp/clippy
assorted clippy cleanups
2 parents 2d02f44 + f44e39e commit 15be6f1

File tree

5 files changed

+13
-15
lines changed

5 files changed

+13
-15
lines changed

examples/shared_stream_controllers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use std::{ops::Deref, sync::Arc, time::Duration};
1+
use std::{future, ops::Deref, sync::Arc, time::Duration};
22

3-
use futures::{future, StreamExt};
3+
use futures::StreamExt;
44
use k8s_openapi::api::{apps::v1::Deployment, core::v1::Pod};
55
use kube::{
66
runtime::{

kube-client/src/client/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ mod tests {
298298
let io: TokioIo<TcpStream> = TokioIo::new(tcp);
299299

300300
tokio::spawn(async move {
301-
let _ = http1::Builder::new()
301+
http1::Builder::new()
302302
.timer(TokioTimer::new())
303303
.serve_connection(
304304
io,

kube-client/src/client/client_ext.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -487,12 +487,7 @@ mod test {
487487

488488
// Fetch using local object reference
489489
let svc: Service = client
490-
.fetch(
491-
&LocalObjectReference {
492-
name: svc.name_any().into(),
493-
}
494-
.within(svc.namespace()),
495-
)
490+
.fetch(&LocalObjectReference { name: svc.name_any() }.within(svc.namespace()))
496491
.await?;
497492
assert_eq!(svc.name_unchecked(), "kubernetes");
498493

kube-core/src/error_boundary.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,19 @@ impl<K: Resource> Resource for DeserializeGuard<K> {
6262
type DynamicType = K::DynamicType;
6363
type Scope = K::Scope;
6464

65-
fn kind(dt: &Self::DynamicType) -> Cow<str> {
65+
fn kind(dt: &'_ Self::DynamicType) -> Cow<'_, str> {
6666
K::kind(dt)
6767
}
6868

69-
fn group(dt: &Self::DynamicType) -> Cow<str> {
69+
fn group(dt: &'_ Self::DynamicType) -> Cow<'_, str> {
7070
K::group(dt)
7171
}
7272

73-
fn version(dt: &Self::DynamicType) -> Cow<str> {
73+
fn version(dt: &'_ Self::DynamicType) -> Cow<'_, str> {
7474
K::version(dt)
7575
}
7676

77-
fn plural(dt: &Self::DynamicType) -> Cow<str> {
77+
fn plural(dt: &'_ Self::DynamicType) -> Cow<'_, str> {
7878
K::plural(dt)
7979
}
8080

kube-runtime/src/scheduler.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,10 @@ where
222222
///
223223
/// NOTE: `can_take_message` should be considered to be fairly performance-sensitive, since
224224
/// it will generally be executed for each pending message, for each [`poll_next`](Self::poll_next).
225-
pub fn hold_unless<C: Fn(&T) -> bool>(self: Pin<&mut Self>, can_take_message: C) -> HoldUnless<T, R, C> {
225+
pub fn hold_unless<C: Fn(&T) -> bool>(
226+
self: Pin<&'_ mut Self>,
227+
can_take_message: C,
228+
) -> HoldUnless<'_, T, R, C> {
226229
HoldUnless {
227230
scheduler: self,
228231
can_take_message,
@@ -233,7 +236,7 @@ where
233236
/// Its equivalent to doing `self.hold_unless(|_| false)` and is useful when the
234237
/// consumer is not ready to consume the expired messages that the [`Scheduler`] emits.
235238
#[must_use]
236-
pub fn hold(self: Pin<&mut Self>) -> Hold<T, R> {
239+
pub fn hold(self: Pin<&'_ mut Self>) -> Hold<'_, T, R> {
237240
Hold { scheduler: self }
238241
}
239242

0 commit comments

Comments
 (0)