Add setters to Location

This commit is contained in:
Temirkhan Myrzamadi 2020-07-28 01:07:18 +06:00
parent c43c5bab49
commit 1ce57eedbc

View file

@ -10,3 +10,19 @@ pub struct Location {
/// Latitude as defined by sender.
pub latitude: f64,
}
impl Location {
pub fn new(longitude: f64, latitude: f64) -> Self {
Self { longitude, latitude }
}
pub fn latitude(mut self, val: f64) -> Self {
self.latitude = val;
self
}
pub fn longitude(mut self, val: f64) -> Self {
self.longitude = val;
self
}
}