CasualX / pelite

Lightweight, memory-safe, zero-allocation library for reading and navigating PE binaries.
MIT License
290 stars 42 forks source link

Replace VersionInfo::translation() -> Option<&[Language]> #196

Closed Ortham closed 5 years ago

Ortham commented 5 years ago

Here's the change I mentioned preferring in my last comment in #134.

VersionInfo::translation() -> Option<&[Language]> becomes VersionInfo::translations() -> &[Language], where the None becomes an empty slice. I think the ergonomics improvement is worth the semantic conflation of finding an empty VarFileInfo block and finding no VarFileInfo block.

CasualX commented 5 years ago

I think I agree, the VersionInfo code already shoves errors under the rug might as well shove some more for a more ergonomic API.

Thanks!