-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature] #NAV-3079 - Ntfs2gtfs - Add ticketing_deep_links to gtfs export #951
Conversation
83e5731
to
6334e05
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋
id: format!("ticketing_deep_link:{}", i + 1), | ||
web_url: Some(fare_url.clone()), | ||
android_intent_uri: Some(fare_url.clone()), | ||
ios_universal_link_url: Some(fare_url.clone()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last one probably don't need a .clone()
🤷
Co-authored-by: Jean SIMARD <[email protected]>
.get(fare_url) | ||
.map(|ticketing_deep_link| ticketing_deep_link.id.clone()) | ||
}) | ||
.or_else(|| Some(String::new())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need to have an empty String here ?
If I understand agency.ticketing_deep_link_id
may have 3 outputs
Some("a_string_not_empty")
ifticketing_deep_links IS NOT empty
andticketing_deep_links.get(fare_url)
existsSome("")
ifticketing_deep_links IS NOT empty
andticketing_deep_links.get(fare_url)
DOES NOT existNone
ifticketing_deep_links IS empty
I think if you have something like
agency.ticketing_deep_link_id = network
.fare_url
.as_ref()
.and_then(|fare_url| {
ticketing_deep_links
.get(fare_url)
.map(|ticketing_deep_link| ticketing_deep_link.id.clone())
});
}
It will return Some("something")
or None
and None
will be serialized to ""
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added comments on the reason for this empty string 81a9cf1
No description provided.