-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Change is_decodable/1
to decodable?/1
#138
Conversation
s_decodable/1
to decodable?/1
s_decodable/1
to decodable?/1
is_decodable/1
to decodable?/1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your support @azeemchauhan I appreciate it!
I would like to make few adjustments to reduce the risk of mistake.
lib/avrora/codec.ex
Outdated
@doc """ | ||
Checks whether a given binary Avro message is decodable with the Plain codec. | ||
|
||
This function is deprecated and will be removed in future release. | ||
Please use `Avrora.Codec.Plain.decodable?/1` instead. | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you delete the documentation @doc false
and use @deprecated "Use ... instead"
Logger.warning( | ||
"`Avrora.Codec.ObjectContainerFile.is_decodable/1` is deprecated, use `Avrora.Codec.ObjectContainerFile.decodable?/1` instead" | ||
) | ||
|
||
case payload do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please replace the code with a call of decodable?
instead of duplication
lib/avrora/codec/plain.ex
Outdated
def is_decodable(payload) when is_binary(payload) do | ||
Logger.warning("`Avrora.Codec.Plain.is_decodable/1` is deprecated, use `Avrora.Codec.Plain.decodable?/1` instead") | ||
|
||
true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please re-use new function instead?
false | ||
""" | ||
@callback decodable?(payload :: binary()) :: boolean | ||
|
||
@doc deprecated: "Use `Avrora.Codec.Plain.decodable?/1` instead." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressing #132
Summary
is_decodable/1
is used.