johnstonskj / rust-atelier

Rust native core model for the AWS Smithy IDL
MIT License
77 stars 11 forks source link

fix: remove panic when assembling empty model set #15

Closed swaits closed 3 years ago

swaits commented 3 years ago

Before, if you attempted to assemble an empty set of models (i.e. a directory with no matching smithy/json files), we panicked.

This is handled in TryFrom by explicitly checking whether the Vec<Model> is empty.

Now, in that case you get a warning logged and an default model returned as Ok().