forked from kube-rs/kube
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…s#1152) * Genericize PartialObjectMeta over the underlying Resource Allows doing static dispatch using the root type, and avoids having to do stringly typed oob signalling in generic code. Signed-off-by: clux <[email protected]> * fmt + clippy fix Signed-off-by: clux <[email protected]> * doc tests + consolidate extensions usage for metadata api Signed-off-by: clux <[email protected]> * clippy Signed-off-by: clux <[email protected]> * add a test converter + a quick unit test conversion the other way avoids users having to write: ```rust let pom = PartialObjectMeta::<Pod> { types: Some(TypeMeta{ ...constant }), metadata: actual_test_data, ..Default::default(), }; ``` Signed-off-by: clux <[email protected]> * check main prop as well Signed-off-by: clux <[email protected]> * Remove/split misguided From<ObjectMeta> for PartialObjectMeta Need to have two different ways to convert from ObjectMeta depending on how we are going to use it. Have created a sealed trait with converters for it, and updated docs, tests to use it. Signed-off-by: clux <[email protected]> * simplify trait bound to just the empty dyn type avoids unstable associated trait bounds + lints showing that the default really had to be the empty type. Signed-off-by: clux <[email protected]> * one clippy lint having a rough one today bunch of new bugs in https://github.com/rust-lang/rust-clippy/issues?q=is%3Aissue+let_underscore_untyped our use seems perfectly fine, what clippy wanted was nonsense: ``` error: non-binding `let` without a type annotation --> kube-runtime/src/reflector/store.rs:87:12 | 87 | pub struct Store<K: 'static + Resource> | ^^^^^ | = help: consider adding a type annotation or removing the `let` keyword = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_untyped error: non-binding `let` without a type annotation --> kube-runtime/src/watcher.rs:123:5 | 123 | InitListed { resource_version: String }, | ^^^^^^^^^^ | = help: consider adding a type annotation or removing the `let` keyword = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_untyped ``` Signed-off-by: clux <[email protected]> --------- Signed-off-by: clux <[email protected]>
- Loading branch information
Showing
8 changed files
with
134 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters