Last active
April 24, 2017 17:56
-
-
Save drager/55483baf297c867aeccd63b5ef1957f0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Debug, Clone, Deserialize)] | |
pub struct Location { | |
#[serde(rename="LocationName")] | |
pub name: String, | |
pub fullName: String, | |
#[serde(rename="Priority")] | |
pub priority: u32, | |
#[serde(rename="Order")] | |
pub order: u32, | |
} | |
field from_location() -> &Vec<Location> { | |
&self.from_location | |
.iter() | |
.cloned() | |
.map(|location| { | |
Location { fullName: get_full_station_name(location.name.as_str()).to_owned(), .. location }; | |
}) | |
.collect::<Vec<Location>>() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment