Fix warning for unwrap_or_else in generated builders (#3307)
While attempting to upgrade to Smithy 1.42, I noticed a warning in the
codegen-client integration tests:
```
warning: unnecessary closure used to substitute value for `Option::None`
--> json_rpc10/rust-client-codegen/src/operation/operation_with_defaults/_operation_with_defaults_output.rs:477:31
|
477 | default_int_enum: self.default_int_enum.unwrap_or_else(|| 1),
| ^^^^^^^^^^^^^^^^^^^^^^--------------------
| |
| help: use `unwrap_or(..)` instead: `unwrap_or(1)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
```
This change fixes these warnings by switching between unwrap_or_else and
unwrap_or based on the shape.
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
Loading
Please sign in to comment