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

editoast: move Side to editoast_schemas #7207

Merged
merged 1 commit into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions editoast/editoast_schemas/src/infra.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
mod direction;
mod directional_track_range;
mod side;
mod track_location;
mod track_offset;
mod track_range;
mod waypoint;

pub use direction::Direction;
pub use directional_track_range::DirectionalTrackRange;
pub use side::Side;
pub use track_location::TrackLocation;
pub use track_offset::TrackOffset;
pub use track_range::TrackRange;
Expand Down
13 changes: 13 additions & 0 deletions editoast/editoast_schemas/src/infra/side.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use derivative::Derivative;
use serde::Deserialize;
use serde::Serialize;

#[derive(Debug, Derivative, Clone, Deserialize, Serialize, PartialEq, Eq)]
#[derivative(Default)]
#[serde(rename_all = "UPPERCASE")]
pub enum Side {
Left,
Right,
#[derivative(Default)]
Center,
}
1 change: 1 addition & 0 deletions editoast/src/converters/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use editoast_schemas::infra::Direction;
use std::collections::HashMap;
use std::str::FromStr;

use editoast_schemas::infra::Side;
use osm4routing::Coord;
use osm4routing::Edge;
use osm4routing::NodeId;
Expand Down
11 changes: 1 addition & 10 deletions editoast/src/schema/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub use buffer_stop::BufferStopCache;
pub use detector::Detector;
pub use detector::DetectorCache;
use editoast_schemas::infra::Direction;
use editoast_schemas::infra::Side;
use editoast_schemas::primitives::OSRDIdentified;
use editoast_schemas::primitives::ObjectType;
pub use electrification::Electrification;
Expand Down Expand Up @@ -153,16 +154,6 @@ impl TrackEndpoint {
}
}

#[derive(Debug, Derivative, Clone, Deserialize, Serialize, PartialEq, Eq)]
#[derivative(Default)]
#[serde(rename_all = "UPPERCASE")]
pub enum Side {
Left,
Right,
#[derivative(Default)]
Center,
}

#[derive(Debug, Derivative, Clone, Deserialize, Serialize, PartialEq)]
#[derivative(Default)]
#[serde(deny_unknown_fields)]
Expand Down
2 changes: 1 addition & 1 deletion editoast/src/schema/signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ use serde::Serialize;

use super::OSRDIdentified;
use super::ObjectType;
use super::Side;
use crate::infra_cache::Cache;
use crate::infra_cache::ObjectCache;
use editoast_common::Identifier;
use editoast_common::NonBlankString;
use editoast_schemas::infra::Direction;
use editoast_schemas::infra::Side;
use editoast_schemas::primitives::OSRDTyped;

#[derive(Debug, Derivative, Clone, Deserialize, Serialize, PartialEq)]
Expand Down
Loading