Skip to content

Commit f7c74bf

Browse files
committed
editoast: define structs schemas! in editoast_schemas
1 parent 89cfb65 commit f7c74bf

File tree

5 files changed

+20
-21
lines changed

5 files changed

+20
-21
lines changed

editoast/Cargo.lock

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

editoast/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ license = "LGPL-3.0"
88
members = [".", "editoast_common", "editoast_derive", "editoast_schemas"]
99

1010
[workspace.dependencies]
11+
editoast_common = { path = "./editoast_common" }
1112
rangemap = "1.5.1"
1213
serde = "1.0.197"
1314
serde_derive = "1.0.197"
@@ -39,7 +40,7 @@ diesel = { version = "2.1.5", features = [
3940
] }
4041
diesel-async = { version = "0.4.1", features = ["deadpool", "postgres"] }
4142
diesel_json = "0.2.1"
42-
editoast_common = { path = "./editoast_common" }
43+
editoast_common = { workspace = true }
4344
editoast_derive = { path = "./editoast_derive" }
4445
editoast_schemas = { path = "./editoast_schemas" }
4546
enum-map = "2.7.3"

editoast/editoast_schemas/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ edition = "2021"
55
license = "LGPL-3.0"
66

77
[dependencies]
8+
editoast_common.workspace = true
89
serde.workspace = true
910
serde_derive.workspace = true
1011
serde_json.workspace = true

editoast/editoast_schemas/src/rolling_stock/mod.rs

+15
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,18 @@ pub use energy_source::EnergySource;
1717
pub use energy_source::EnergyStorage;
1818
pub use energy_source::RefillLaw;
1919
pub use energy_source::SpeedDependantPower;
20+
21+
editoast_common::schemas! {
22+
Gamma,
23+
ConditionalEffortCurve,
24+
EffortCurve,
25+
EffortCurves,
26+
EffortCurveConditions,
27+
ModeEffortCurves,
28+
RollingStockComfortType,
29+
RollingResistance,
30+
EnergySource,
31+
EnergyStorage,
32+
RefillLaw,
33+
SpeedDependantPower,
34+
}

editoast/src/schema/rolling_stock/mod.rs

+1-20
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,10 @@ pub mod rolling_stock_livery;
44
use std::collections::HashMap;
55

66
use derivative::Derivative;
7-
use editoast_schemas::rolling_stock::ConditionalEffortCurve;
8-
use editoast_schemas::rolling_stock::EffortCurve;
9-
use editoast_schemas::rolling_stock::EffortCurveConditions;
107
use editoast_schemas::rolling_stock::EffortCurves;
118
use editoast_schemas::rolling_stock::EnergySource;
12-
use editoast_schemas::rolling_stock::EnergyStorage;
139
use editoast_schemas::rolling_stock::Gamma;
14-
use editoast_schemas::rolling_stock::ModeEffortCurves;
15-
use editoast_schemas::rolling_stock::RefillLaw;
1610
use editoast_schemas::rolling_stock::RollingResistance;
17-
use editoast_schemas::rolling_stock::RollingStockComfortType;
18-
use editoast_schemas::rolling_stock::SpeedDependantPower;
1911
use serde::Deserialize;
2012
use serde::Serialize;
2113
use utoipa::ToSchema;
@@ -26,23 +18,12 @@ use crate::schema::rolling_stock::rolling_stock_livery::RollingStockLiveryMetada
2618
use crate::schema::track_section::LoadingGaugeType;
2719

2820
editoast_common::schemas! {
29-
RollingStockComfortType,
3021
RollingStockCommon,
3122
RollingStockLivery,
3223
RollingStockLiveryMetadata,
3324
RollingStockWithLiveries,
34-
RollingResistance,
3525
RollingStockMetadata,
36-
Gamma,
37-
EffortCurve,
38-
EffortCurves,
39-
EffortCurveConditions,
40-
ConditionalEffortCurve,
41-
ModeEffortCurves,
42-
EnergySource,
43-
SpeedDependantPower,
44-
EnergyStorage,
45-
RefillLaw,
26+
editoast_schemas::rolling_stock::schemas(),
4627
light_rolling_stock::schemas(),
4728
}
4829

0 commit comments

Comments
 (0)