smithy-lang / smithy-rs

Code generation for the AWS SDK for Rust, as well as server and generic smithy client generation.
Apache License 2.0
508 stars 190 forks source link

Enhance methods in SDK taking `Blob` to take `impl Into<Blob>` instead #3879

Open ysaito1001 opened 1 month ago

ysaito1001 commented 1 month ago

This issue tracks a complementary task for https://github.com/smithy-lang/smithy-rs/pull/3877.

The previous PR introduced conversions between Vec<u8> and Blob, as well as from &[u8] to Blob. However, these changes do not immediately improve the ergonomics of the following method call (example from kms):

src/types/_recipient_info.rs:    pub fn set_attestation_document(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {

To enhance the ergonomics of call sites, this codegen update modifies the method signature to accept Option<impl Into<Blob>>.