Skip to content

Commit

Permalink
fix(codegen): lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Nugine committed Nov 16, 2024
1 parent c49bd8e commit 023767e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions codegen/src/v1/dto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ pub fn collect_rust_types(model: &smithy::Model, ops: &Operations) -> RustTypes
let default_value = field.traits.default_value().map(o);
let is_required = field.traits.required();

let is_op_input = rs_shape_name.strip_suffix("Request").map_or(false, |op| ops.contains_key(op));
let is_op_input = rs_shape_name.strip_suffix("Request").is_some_and(|op| ops.contains_key(op));

let option_type = 'optional: {
if field_type == "StreamingBlob" && default_value.as_ref().unwrap() == "" {
Expand Down Expand Up @@ -595,7 +595,7 @@ fn is_default_field(field: &rust::StructField, rust_types: &RustTypes) -> bool {
return true;
}

field.default_value.as_ref().map_or(false, is_rust_default)
field.default_value.as_ref().is_some_and(is_rust_default)
}

fn codegen_builders(rust_types: &RustTypes, ops: &Operations) {
Expand Down
2 changes: 1 addition & 1 deletion codegen/src/v1/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ pub fn collect_operations(model: &smithy::Model) -> Operations {
}

pub fn is_op_input(name: &str, ops: &Operations) -> bool {
name.strip_suffix("Input").map_or(false, |x| ops.contains_key(x))
name.strip_suffix("Input").is_some_and(|x| ops.contains_key(x))
}

pub fn codegen(ops: &Operations, rust_types: &RustTypes) {
Expand Down

0 comments on commit 023767e

Please sign in to comment.