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

impl TryFrom<i64> for Cell #45

Merged
merged 1 commit into from
Apr 22, 2024
Merged

impl TryFrom<i64> for Cell #45

merged 1 commit into from
Apr 22, 2024

Conversation

JayKickliter
Copy link
Owner

@JayKickliter JayKickliter merged commit f3ac308 into main Apr 22, 2024
2 checks passed
@JayKickliter JayKickliter deleted the jsk/add-try-from-i64 branch April 22, 2024 22:55
michaeldjeffrey added a commit to helium/oracles that referenced this pull request Apr 23, 2024
Update includes an implementation of TryFrom<i64> for Cell.

This allows adding `#[sqlx(try_from = "i64")]` to struct fields of `hextree::Cell`.

JayKickliter/HexTree#45
michaeldjeffrey added a commit to helium/oracles that referenced this pull request Apr 26, 2024
Update includes an implementation of TryFrom<i64> for Cell.

This allows adding `#[sqlx(try_from = "i64")]` to struct fields of `hextree::Cell`.

JayKickliter/HexTree#45
michaeldjeffrey added a commit to helium/oracles that referenced this pull request Apr 26, 2024
Update includes an implementation of TryFrom<i64> for Cell.

This allows adding `#[sqlx(try_from = "i64")]` to struct fields of `hextree::Cell`.

JayKickliter/HexTree#45
michaeldjeffrey added a commit to helium/oracles that referenced this pull request Apr 26, 2024
* Update hextree dependency

Update includes an implementation of TryFrom<i64> for Cell.

This allows adding `#[sqlx(try_from = "i64")]` to struct fields of `hextree::Cell`.

JayKickliter/HexTree#45

* Use `hextree::Cell` for BoostedHex and HexCoverage

Got some advice from Jay to only use a `h3o::CellIndex` when you need to
convert to/from a LatLng. So we went with `hextree::Cell` for the type.

`hextree::Cell` is a loose wrapper around a u64. Parsing the value as
early as possible tightens the gaurantee that we can make valid types
that need use `Cell`s.

It is also an attempt to remove discrepancies where some types carry a
`i64` hex straight from a database, and other types carry a `u64` that
were converted out of a database, even though they're goal is the same.

(see previous commit where `#[sqlx(try_from = "i64")]` was enabled by
the update to hextree).
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.

None yet

2 participants