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

modified type from u16 to u32 #30

Merged
merged 1 commit into from
Jun 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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