Produce `&[T]` instead of `Option<&[T]>` for list fields (#2995)
## Motivation and Context When the returned field is a list, there is _almost_ never a reason to know if the returned value was null or `[]` — this addresses the 99% case. Before: ```rust fn blah(&self) -> Option<&[T]> { self.blah.as_deref() } ``` After: ```rust fn blah(&self) -> &[T] { self.blah.as_deref().unwrap_or_default() } ``` **note**: no impact on servers by default, see codegen diff. ## Description Update accessors for lists. ## Testing - [x] codegen diff audit (no server changes) - [x] unit tests ## Checklist <!--- If a checkbox below is not applicable, then please DELETE it rather than leaving it unchecked --> - [x] I have updated `CHANGELOG.next.toml` if I made changes to the smithy-rs codegen or runtime crates - [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS SDK, generated SDK code, or SDK runtime crates ---- _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 register or sign in to comment