Skip to content

Commit

Permalink
Clippy fixes in runtime
Browse files Browse the repository at this point in the history
Most from cargo +nightly clippy --fix
one explicit allow because runtime has deny all.

Signed-off-by: clux <[email protected]>
  • Loading branch information
clux committed Oct 8, 2024
1 parent 3c3939f commit b789092
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions kube-runtime/src/controller/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ const APPLIER_REQUEUE_BUF_SIZE: usize = 100;
/// This is the "hard-mode" version of [`Controller`], which allows you some more customization
/// (such as triggering from arbitrary [`Stream`]s), at the cost of being a bit more verbose.
#[allow(clippy::needless_pass_by_value)]
#[allow(clippy::type_complexity)]
pub fn applier<K, QueueStream, ReconcilerFut, Ctx>(
mut reconciler: impl FnMut(Arc<K>, Arc<Ctx>) -> ReconcilerFut,
error_policy: impl Fn(Arc<K>, &ReconcilerFut::Error, Arc<Ctx>) -> Action,
Expand Down
4 changes: 3 additions & 1 deletion kube-runtime/src/reflector/store.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use super::{dispatcher::Dispatcher, Lookup, ObjectRef, ReflectHandle};
use super::{dispatcher::Dispatcher, Lookup, ObjectRef};
#[cfg(feature = "unstable-runtime-subscribe")]
use crate::reflector::ReflectHandle;
use crate::{
utils::delayed_init::{self, DelayedInit},
watcher,
Expand Down
6 changes: 3 additions & 3 deletions kube-runtime/src/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl<T, R: Stream> Scheduler<T, R> {
}
}

impl<'a, T: Hash + Eq + Clone, R> SchedulerProj<'a, T, R> {
impl<T: Hash + Eq + Clone, R> SchedulerProj<'_, T, R> {
/// Attempt to schedule a message into the queue.
///
/// If the message is already in the queue then the earlier `request.run_at` takes precedence.
Expand Down Expand Up @@ -147,7 +147,7 @@ pub struct Hold<'a, T, R> {
scheduler: Pin<&'a mut Scheduler<T, R>>,
}

impl<'a, T, R> Stream for Hold<'a, T, R>
impl<T, R> Stream for Hold<'_, T, R>
where
T: Eq + Hash + Clone,
R: Stream<Item = ScheduleRequest<T>>,
Expand Down Expand Up @@ -177,7 +177,7 @@ pub struct HoldUnless<'a, T, R, C> {
can_take_message: C,
}

impl<'a, T, R, C> Stream for HoldUnless<'a, T, R, C>
impl<T, R, C> Stream for HoldUnless<'_, T, R, C>
where
T: Eq + Hash + Clone,
R: Stream<Item = ScheduleRequest<T>>,
Expand Down
2 changes: 1 addition & 1 deletion kube-runtime/src/utils/delayed_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl<T: Clone + Send + Sync> DelayedInit<T> {
// Using a manually implemented future because we don't want to hold the lock across poll calls
// since that would mean that an unpolled writer would stall all other tasks from being able to poll it
struct Get<'a, T>(&'a DelayedInit<T>);
impl<'a, T> Future for Get<'a, T>
impl<T> Future for Get<'_, T>
where
T: Clone,
{
Expand Down

0 comments on commit b789092

Please sign in to comment.