Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Commit

Permalink
fix: warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
hugo-b-r committed Mar 7, 2023
1 parent c5dfcbd commit e54411f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub fn get_coordinates(address: String) -> Result<Vec<Point<f64>>, String> {
struct DegreesMinutesSeconds {
degrees: i32,
minutes: i32,
seconds: f64,
_seconds: f64,
bearing: Orientation,
}

Expand All @@ -75,15 +75,15 @@ enum Orientation {
}

impl DegreesMinutesSeconds {
fn is_latitude(self: Self) -> bool {
fn _is_latitude(self: Self) -> bool {
if self.bearing == Orientation::North || self.bearing == Orientation::South {
true
} else {
false
}
}

fn is_longitude(self: Self) -> bool {
fn _is_longitude(self: Self) -> bool {
if self.bearing == Orientation::East || self.bearing == Orientation::West {
true
} else {
Expand All @@ -102,7 +102,7 @@ impl Orientation {
}
}

fn is_northern(self: Self) -> bool {
fn _is_northern(self: Self) -> bool {
if self == Orientation::North {
true
} else {
Expand All @@ -111,7 +111,7 @@ impl Orientation {
}


fn is_eastern(self: Self) -> bool {
fn _is_eastern(self: Self) -> bool {
if self == Orientation::East {
true
} else {
Expand Down Expand Up @@ -142,14 +142,14 @@ impl Orientation {
fn dms_from_decimal(decimal: f64, mut bearing: Orientation) -> DegreesMinutesSeconds {
let degrees = decimal.abs().trunc() as i32;
let minutes = ((decimal.abs() - degrees as f64) * 60.0).trunc() as i32;
let seconds = ((((decimal.abs() - degrees as f64) * 60.0) - minutes as f64) * 60.0).trunc() as f64;
let _seconds = ((((decimal.abs() - degrees as f64) * 60.0) - minutes as f64) * 60.0).trunc() as f64;
if decimal < 0.0 {
bearing = bearing.opposite();
}
DegreesMinutesSeconds {
degrees,
minutes,
seconds,
_seconds,
bearing,
}
}
Expand Down

0 comments on commit e54411f

Please sign in to comment.