Implement derive(ValidateSchema)
macro for generating cel validation on CRDs
#3552
Annotations
9 warnings
Run clechasseur/rs-clippy-check@v3:
kube-derive/src/custom_resource.rs#L3
warning: unused import: `std::collections::BTreeMap`
--> kube-derive/src/custom_resource.rs:3:5
|
3 | use std::collections::BTreeMap;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
|
Run clechasseur/rs-clippy-check@v3:
kube-derive/src/custom_resource.rs#L7
warning: unused imports: `FromAttributes` and `path_to_string`
--> kube-derive/src/custom_resource.rs:7:18
|
7 | util::{self, path_to_string, IdentString},
| ^^^^^^^^^^^^^^
8 | FromAttributes, FromDeriveInput, FromField, FromMeta,
| ^^^^^^^^^^^^^^
|
Run clechasseur/rs-clippy-check@v3:
kube-derive/src/custom_resource.rs#L13
warning: unused imports: `Attribute`, `ExprCall`, and `Stmt`
--> kube-derive/src/custom_resource.rs:13:36
|
13 | parse_quote, spanned::Spanned, Attribute, Data, DeriveInput, Expr, ExprCall, Path, Stmt, Type, Visibility,
| ^^^^^^^^^ ^^^^^^^^ ^^^^
|
Run clechasseur/rs-clippy-check@v3:
kube-derive/src/custom_resource.rs#L13
warning: unused import: `spanned::Spanned`
--> kube-derive/src/custom_resource.rs:13:18
|
13 | parse_quote, spanned::Spanned, Attribute, Data, DeriveInput, Expr, ExprCall, Path, Stmt, Type, Visibility,
| ^^^^^^^^^^^^^^^^
|
Run clechasseur/rs-clippy-check@v3:
kube-derive/src/custom_resource.rs#L3
warning: unused import: `std::collections::BTreeMap`
--> kube-derive/src/custom_resource.rs:3:5
|
3 | use std::collections::BTreeMap;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
|
Run clechasseur/rs-clippy-check@v3:
kube-derive/src/custom_resource.rs#L7
warning: unused imports: `FromAttributes` and `path_to_string`
--> kube-derive/src/custom_resource.rs:7:18
|
7 | util::{self, path_to_string, IdentString},
| ^^^^^^^^^^^^^^
8 | FromAttributes, FromDeriveInput, FromField, FromMeta,
| ^^^^^^^^^^^^^^
|
Run clechasseur/rs-clippy-check@v3:
kube-derive/src/custom_resource.rs#L13
warning: unused imports: `Attribute`, `ExprCall`, and `Stmt`
--> kube-derive/src/custom_resource.rs:13:36
|
13 | parse_quote, spanned::Spanned, Attribute, Data, DeriveInput, Expr, ExprCall, Path, Stmt, Type, Visibility,
| ^^^^^^^^^ ^^^^^^^^ ^^^^
|
Run clechasseur/rs-clippy-check@v3:
kube-derive/src/custom_resource.rs#L13
warning: unused import: `spanned::Spanned`
--> kube-derive/src/custom_resource.rs:13:18
|
13 | parse_quote, spanned::Spanned, Attribute, Data, DeriveInput, Expr, ExprCall, Path, Stmt, Type, Visibility,
| ^^^^^^^^^^^^^^^^
|
Run clechasseur/rs-clippy-check@v3:
kube-core/src/validation.rs#L122
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
--> kube-core/src/validation.rs:122:5
|
122 | / match s {
123 | | Schema::Object(s) => {
124 | | if let Some(schema) = s.object().properties.values_mut().nth(property) {
125 | | validate(schema, rules)?;
... |
128 | | _ => (),
129 | | };
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
= note: `#[warn(clippy::single_match)]` on by default
help: try
|
122 ~ if let Schema::Object(s) = s {
123 + if let Some(schema) = s.object().properties.values_mut().nth(property) {
124 + validate(schema, rules)?;
125 + }
126 ~ };
|
|
Loading