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

Update specs #157

Merged
merged 1 commit into from
Apr 10, 2021
Merged

Update specs #157

merged 1 commit into from
Apr 10, 2021

Conversation

wojtekmach
Copy link
Contributor

No description provided.

@@ -30,7 +30,7 @@ defmodule Geo.JSON do
@doc """
Takes a map representing GeoJSON and returns a Geometry.
"""
@spec decode!(map()) :: Geo.geometry() | no_return
Copy link
Contributor Author

Choose a reason for hiding this comment

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

no_return should be used when the function never returns (always raises, throws, endlessly loops, etc). Otherwise we'd need to annotate almost every function as they may e.g. raise an exception for invalid args, function clause, etc!

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah got it. That makes sense

@@ -79,7 +81,7 @@ defmodule Geo.WKB do
@doc """
Takes a WKB string and returns a Geometry.
"""
@spec decode!(binary | iodata()) :: Geo.geometry() | no_return
@spec decode!(iodata()) :: Geo.geometry()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I really don't think there's a use case for accepting an iodata, I'm happy to send a PR which removes the IO.iodata_to_binary call and thus this function just accepts a binary. And if there's a use case, we could always add it then. WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

Removing the IO.iodata_to_binary call makes sense to me. I can see by updating the postgrex extension it's not needed there. I can accept a PR to remove that 👍🏿

@bryanjos bryanjos merged commit 7b0aed4 into felt:master Apr 10, 2021
@bryanjos
Copy link
Contributor

Thanks!

@wojtekmach wojtekmach deleted the wm-specs branch April 11, 2021 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants