Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using empty strings instead of nil #21

Merged
merged 3 commits into from
Oct 16, 2020

Conversation

igorescobar
Copy link
Collaborator

Addressing issue #11

@igorescobar igorescobar changed the base branch from main to v1.0.0 October 16, 2020 15:55
Copy link
Collaborator

@randycoulman randycoulman left a comment

Choose a reason for hiding this comment

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

This looks great! The only thing is that I think the default value for custom should be an empty map (%{}), not an empty string. That'll affect several places in the updated code, I think.

@@ -1,6 +1,6 @@
defmodule ConfigCat.User do
@enforce_keys :identifier
defstruct [:identifier, email: nil, country: nil, custom: nil]
defstruct [:identifier, country: "", email: "", custom: ""]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should custom be %{} instead of an empty string? As I understand it, custom is a nested map of additional properties.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well spotted @randycoulman , fixed 👍

Copy link
Collaborator

@randycoulman randycoulman left a comment

Choose a reason for hiding this comment

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

Changes LGTM!

@igorescobar igorescobar merged commit c6208c2 into v1.0.0 Oct 16, 2020
@igorescobar igorescobar deleted the changes/11/empty_instead_of_nil branch October 16, 2020 16:28
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