kean / Get

Web API client built using async/await
MIT License
943 stars 75 forks source link

Updated decode and encode functions to avoid forced downcasting #64

Closed oscardemoya closed 2 years ago

kean commented 2 years ago

Is there a problem you encountered with force cast?

oscardemoya commented 2 years ago

Is there a problem you encountered with force cast?

Not really, just to prevent any crash if by mistake some change is done like implementing OptionalDecoding to other type different than Optional.

TestForceCast.playground.zip

kean commented 2 years ago

Thanks for the PR, @oscardemoya. I understand the reasoning behind the changes, but since it's mainly a cosmetic change, I think I'd rather keep the original version – it's a bit more clear to me at least.