Resolving linting problems in geo-types
This commit is contained in:
parent
49b1865818
commit
5443015868
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue