Skip to content
This repository has been archived by the owner on Nov 8, 2018. It is now read-only.

Commit

Permalink
Merge pull request #30 from ikegam/type-u16
Browse files Browse the repository at this point in the history
modified type from u16 to u32
  • Loading branch information
Ortham committed Jun 10, 2018
2 parents 19bed3e + 49de397 commit 5341ff7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/golo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ impl GoogleLocationHistory {
/// between interpolated locations, according to the time difference between the given timestamp
/// the nearest location timestamp. If the half-distance is smaller than both location accuracies,
/// ignore it and linearly scale between the two accuracies instead.
fn interpolate_accuracy(timestamp_ms: i64, before: &Location, after: &Location) -> u16 {
fn interpolate_accuracy(timestamp_ms: i64, before: &Location, after: &Location) -> u32 {
let time_offset = timestamp_ms - before.timestamp_ms;
let time_difference = after.timestamp_ms - before.timestamp_ms;

Expand All @@ -144,7 +144,7 @@ fn interpolate_accuracy(timestamp_ms: i64, before: &Location, after: &Location)
/ time_difference
};

accuracy as u16
accuracy as u32
}

#[derive(Clone, Deserialize, PartialEq, Debug)]
Expand All @@ -154,7 +154,7 @@ pub struct Location {
timestamp_ms: i64,
latitude_e7: i64,
longitude_e7: i64,
accuracy: u16,
accuracy: u32,
}

impl Location {
Expand All @@ -165,7 +165,7 @@ impl Location {
)
}

pub fn accuracy(&self) -> u16 {
pub fn accuracy(&self) -> u32 {
self.accuracy
}

Expand Down
6 changes: 3 additions & 3 deletions src/suggestion_accuracy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ use chrono::Duration;

#[derive(Debug, PartialEq, Serialize)]
pub struct SuggestionAccuracy {
meters: u16,
meters: u32,
seconds: i64,
}

impl SuggestionAccuracy {
pub fn new(meters: u16, seconds: i64) -> SuggestionAccuracy {
pub fn new(meters: u32, seconds: i64) -> SuggestionAccuracy {
SuggestionAccuracy { meters, seconds }
}

pub fn meters(&self) -> u16 {
pub fn meters(&self) -> u32 {
self.meters
}

Expand Down

0 comments on commit 5341ff7

Please sign in to comment.