-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add Into conversions for Blob to [u8] #3877
Conversation
Thanks for contributing. I have two questions.
Is it possible that you could point us to an example function, just to be on the same page? Q2. What's the reason for also adding
when |
How about Better yet, look at the docs for aws-sdk-kms and search for
I dunno. Completeness I guess, or symmetry . I'll delete it, if it's a problem. |
Hmm in
(I don't either in Can you send us a URL to the doc for a function/method that takes |
I was only referring to functions that that a Blob, not Into There's a chicken and egg problem. Why support an Into parameter type, if there aren't any types that support Into yet. Personally, I think .into() is much preferable to Blob::new, because it's more idiomatic and more discoverable. The compiler will tell you "use .into()" whereas without it, one must dig through the documentation to find Blob::new. |
Ah, I see where you're coming from. These methods in Thanks again for contributing. Could you bump the version of |
Motivation and Context
Often I have a &[u8] or a Vec, but the sdk function takes a Blob.
It would be convenient to pass the my_vec instead of aws_smithy_types::Blob::new(my_vec)
Description
In blob.rs I added
Into<Vec> for Blob
Into for Vec
Into for &[u8]
Testing
Added a test to blob.rs to test the various scenarios.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.