mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-14 11:44:04 +01:00
Add setters to Location
This commit is contained in:
parent
c43c5bab49
commit
1ce57eedbc
1 changed files with 16 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue