Skip to content

Implement derive(CELSchema) macro for generating cel validation on CRDs #3552

Implement derive(CELSchema) macro for generating cel validation on CRDs

Implement derive(CELSchema) macro for generating cel validation on CRDs #3552

Triggered via pull request November 24, 2024 17:48
Status Success
Total duration 1m 49s
Artifacts

clippy.yml

on: pull_request
clippy_nightly
49s
clippy_nightly
Fit to window
Zoom out
Zoom in

Annotations

9 warnings
unused import: `std::collections::BTreeMap`: 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
unused imports: `FromAttributes` and `path_to_string`: 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, | ^^^^^^^^^^^^^^
unused imports: `Attribute`, `ExprCall`, and `Stmt`: 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, | ^^^^^^^^^ ^^^^^^^^ ^^^^
unused import: `spanned::Spanned`: 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, | ^^^^^^^^^^^^^^^^
unused import: `std::collections::BTreeMap`: 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
unused imports: `FromAttributes` and `path_to_string`: 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, | ^^^^^^^^^^^^^^
unused imports: `Attribute`, `ExprCall`, and `Stmt`: 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, | ^^^^^^^^^ ^^^^^^^^ ^^^^
unused import: `spanned::Spanned`: 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, | ^^^^^^^^^^^^^^^^
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: 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 ~ }; |