Skip to content

Instantly share code, notes, and snippets.

@drager
Last active April 24, 2017 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drager/55483baf297c867aeccd63b5ef1957f0 to your computer and use it in GitHub Desktop.
Save drager/55483baf297c867aeccd63b5ef1957f0 to your computer and use it in GitHub Desktop.
#[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