Skip to content

Conversation

@siemensikkema
Copy link
Contributor

@siemensikkema siemensikkema commented May 13, 2020

  • replace use of the helper function Encodable+EncodeIfNotNil with the equivalent and built in Encoder.encodeIfPresent.
  • align use of newlines in Codable implementations
  • remove unused extension on Optional
  • remove 1 whitespace

(made possible with the help of Xcode multiline editing 😅)

@siemensikkema siemensikkema changed the title Feature/use encode if present Use encodeIfPresent instead of custom helper function May 13, 2020
Copy link
Owner

@mattpolzin mattpolzin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow. I'm a little bit shocked I never noticed that encodeIfPresent() existed in all the time I was using encodeIfNotNil().

Nice to get rid of a superfluous utility function and doubly nice to bring the property name and the coding key closer together in the source code (horizontal reading distance). 👍

@mattpolzin mattpolzin merged commit 732251a into mattpolzin:master May 14, 2020
@siemensikkema siemensikkema deleted the feature/use-encode-if-present branch May 14, 2020 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants