You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It can serialize Option<String>, which is why we never realized this basic shortcoming (only the client SDKs heavily exercise the restXml protocol in CI).
The problem manifests itself easily when generating a server SDK, since required is honored as non-Optional String.
error: this expression creates a reference which is immediately dereferenced by the compiler
--> simple/rust-server-codegen/src/xml_ser.rs:10:27
|
10 | inner_writer.data(&input.required_string.as_ref());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `input.required_string.as_ref()`
|
= note: `-D clippy::needless-borrow` implied by `-D warnings`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
The logic that keeps track of whether we're working with a borrowed or
an owned value is flawed. It just so happened to work when requesting
owned values from borrowed values because we called `autoDeref` before
creating the value expression. That logic should instead be used
_within_ `ValueExpression` to appease Clippy there too.
Fixes#1831.
The logic that keeps track of whether we're working with a borrowed or
an owned value is flawed. It just so happened to work when requesting
owned values from borrowed values because we called `autoDeref` before
creating the value expression. That logic should instead be used
_within_ `ValueExpression` to appease Clippy there too.
Fixes#1831.
It can serialize
Option<String>
, which is why we never realized this basic shortcoming (only the client SDKs heavily exercise therestXml
protocol in CI).The problem manifests itself easily when generating a server SDK, since
required
is honored as non-Option
alString
.Model:
Generated code (
input.required_string
is of typeString
):Clippy output:
Relevant code:
https://github.com/awslabs/smithy-rs/blob/e78da5598a2d94d23fd18e30492a20ce3603f844/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/serialize/XmlBindingTraitSerializerGenerator.kt#L292-L292
The text was updated successfully, but these errors were encountered: