Skip to content
Unverified Commit ad119f6e authored by Fahad Zubair's avatar Fahad Zubair Committed by GitHub
Browse files

Use `std::result::Result` instead of `Result` (#4010)



When the model contains a shape by the name of `Result`, the generated
code fails to compile. For instance the following model fails:

```smithy
@restJson1
service ConstrainedService {
    operations: [SampleOperation]
}

@http(uri: "/anOperation", method: "POST")
operation SampleOperation {
    output: SampleInputOutput
    input: SampleInputOutput
    errors: [ValidationException]
}

structure SampleInputOutput {
    result: Result
}

structure Result {
    @pattern("^a-z$")
    chat: String
}
```

This PR ensures:

1. If `rustTemplate` is being used, then `#{Result}` is used
2. If `rust` is being used, then that is changed to `rustTemplate` and
then `#{Result}` is used.
3. If `rustBlock` is being used, then the generated code should use
`std::result::Result`

---------

Co-authored-by: default avatarFahad Zubair <fahadzub@amazon.com>
Co-authored-by: default avatarAWS SDK Rust Bot <aws-sdk-rust-primary@amazon.com>
Co-authored-by: default avatarRussell Cohen <rcoh@amazon.com>
Co-authored-by: default avatardavid-perez <d@vidp.dev>
Co-authored-by: default avatarLandon James <lnj@amazon.com>
parent 891a82ba
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment