Skip to content

Commit

Permalink
Merge pull request #39 from georust/fix/range-contains
Browse files Browse the repository at this point in the history
fix lint warnings on range check
  • Loading branch information
sunng87 authored Jan 16, 2021
2 parents 28dbca8 + 5cac4e7 commit 316db09
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,15 @@ pub fn decode_bbox(hash_str: &str) -> Result<Rect<f64>, GeohashError> {

fn hash_value_of_char(c: char) -> Result<usize, GeohashError> {
let ord = c as usize;
if 48 <= ord && ord <= 57 {
if (48..=57).contains(&ord) {
return Ok(ord - 48);
} else if 98 <= ord && ord <= 104 {
} else if (98..=104).contains(&ord) {
return Ok(ord - 88);
} else if 106 <= ord && ord <= 107 {
} else if (106..=107).contains(&ord) {
return Ok(ord - 89);
} else if 109 <= ord && ord <= 110 {
} else if (109..=110).contains(&ord) {
return Ok(ord - 90);
} else if 112 <= ord && ord <= 122 {
} else if (112..=122).contains(&ord) {
return Ok(ord - 91);
}
Err(GeohashError::InvalidHashCharacter(c))
Expand Down

0 comments on commit 316db09

Please sign in to comment.