Skip to content
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

[tech] Add default direction_type (forward) to route #664

Merged
merged 2 commits into from
Jun 26, 2020

Conversation

ArnaudOggy
Copy link
Contributor

@ArnaudOggy ArnaudOggy commented Jun 26, 2020

If a route doesn't have a direction_type (or empty), the direction_type "forward" is assigned by default.

In order to lighten the workload, we will use a new generic method enhance_route_directions.
Later it will disappear by deleting the Option on the direction_type field on Route structure
(which will require an update of the ntfs)

Ref. ND-945

src/model.rs Outdated
Comment on lines 945 to 949
let mut routes = self.routes.take();
for mut route in &mut routes.iter_mut().filter(|r| r.direction_type.is_none()) {
route.direction_type = Some(String::from("forward"));
}
self.routes = CollectionWithId::new(routes).unwrap();

This comment was marked as outdated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in a441d06
Thanks 👍

@woshilapin woshilapin merged commit b834e43 into hove-io:master Jun 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants