Skip to content

Commit

Permalink
(feat) update geotype to 0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sunng87 committed Aug 20, 2020
1 parent 61457c7 commit d46d8a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ documentation = "https://docs.rs/geohash/"
edition = "2018"

[dependencies]
geo-types = "0.4.2"
geo-types = "0.6.0"
failure = "0.1.2"

[dev-dependencies]
Expand Down
12 changes: 6 additions & 6 deletions src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,16 @@ pub fn decode_bbox(hash_str: &str) -> Result<Rect<f64>, Error> {
}
}

Ok(Rect {
min: Coordinate {
Ok(Rect::new(
Coordinate {
x: min_lon,
y: min_lat,
},
max: Coordinate {
Coordinate {
x: max_lon,
y: max_lat,
},
})
))
}

fn hash_value_of_char(c: char) -> Result<usize, Error> {
Expand Down Expand Up @@ -196,8 +196,8 @@ fn hash_value_of_char(c: char) -> Result<usize, Error> {
/// ```
pub fn decode(hash_str: &str) -> Result<(Coordinate<f64>, f64, f64), Error> {
let rect = decode_bbox(hash_str)?;
let c0 = rect.min;
let c1 = rect.max;
let c0 = rect.min();
let c1 = rect.max();
Ok((
Coordinate {
x: (c0.x + c1.x) / 2f64,
Expand Down

0 comments on commit d46d8a3

Please sign in to comment.