Skip to content

Commit

Permalink
simplify trait bound to just the empty dyn type
Browse files Browse the repository at this point in the history
avoids unstable associated trait bounds + lints showing that the default really had to be the empty type.

Signed-off-by: clux <[email protected]>
  • Loading branch information
clux committed Mar 1, 2023
1 parent b275c74 commit c228fb6
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions kube-core/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,15 @@ pub trait PartialObjectMetaExt: private::Sealed {
/// because it contains erased `TypeMeta` (and the apiserver is doing the erasing).
///
/// This method is useful when unit testing local behaviour.
fn into_response_partial<K: Resource>(self) -> PartialObjectMeta<K>;
fn into_response_partial<K>(self) -> PartialObjectMeta<K>;
}

impl PartialObjectMetaExt for ObjectMeta {
fn into_request_partial<K: Resource<DynamicType = ()>>(self) -> PartialObjectMeta<K>
where
K::DynamicType: Default,
{
let dyntype: K::DynamicType = Default::default();
fn into_request_partial<K: Resource<DynamicType = ()>>(self) -> PartialObjectMeta<K> {
PartialObjectMeta {
types: Some(TypeMeta {
api_version: K::api_version(&dyntype).into(),
kind: K::kind(&dyntype).into(),
api_version: K::api_version(&()).into(),
kind: K::kind(&()).into(),
}),
metadata: self,
_phantom: PhantomData,
Expand Down

0 comments on commit c228fb6

Please sign in to comment.