mirror of
https://git.proxmox.com/git/proxmox
synced 2025-10-04 21:51:29 +00:00
api-macro: clippy fixes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
c78c47cff2
commit
31a569b425
@ -310,7 +310,7 @@ fn handle_function_signature(
|
|||||||
// For any named type which exists on the function signature...
|
// For any named type which exists on the function signature...
|
||||||
if let Some(entry) = input_schema.find_obj_property_by_ident_mut(&pat.ident.to_string()) {
|
if let Some(entry) = input_schema.find_obj_property_by_ident_mut(&pat.ident.to_string()) {
|
||||||
// try to infer the type in the schema if it is not specified explicitly:
|
// try to infer the type in the schema if it is not specified explicitly:
|
||||||
let is_option = util::infer_type(&mut entry.schema, &*pat_type.ty)?;
|
let is_option = util::infer_type(&mut entry.schema, &pat_type.ty)?;
|
||||||
let has_default = entry.schema.find_schema_property("default").is_some();
|
let has_default = entry.schema.find_schema_property("default").is_some();
|
||||||
if !is_option && entry.optional.expect_bool() && !has_default {
|
if !is_option && entry.optional.expect_bool() && !has_default {
|
||||||
error!(pat_type => "optional types need a default or be an Option<T>");
|
error!(pat_type => "optional types need a default or be an Option<T>");
|
||||||
|
Loading…
Reference in New Issue
Block a user