Resolving linting problems in geo-types

This commit is contained in:
Savanni D'Gerinel 2023-10-04 16:34:04 -04:00
parent d7a810c50b
commit 8766692781
1 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@ pub struct Latitude(f32);
impl From<f32> for Latitude {
fn from(val: f32) -> Self {
if val > 90.0 || val < -90.0 {
if !(-90.0..=90.0).contains(&val) {
panic!("Latitude is outside of range");
}
Self(val)
@ -23,7 +23,7 @@ pub struct Longitude(f32);
impl From<f32> for Longitude {
fn from(val: f32) -> Self {
if val > 180.0 || val < -180.0 {
if !(-180.0..=180.0).contains(&val) {
panic!("Longitude is outside fo range");
}
Self(val)