refactor: split large modules and normalize rust layout
This commit is contained in:
37
server-rs/crates/api-server/src/match3d/runtime.rs
Normal file
37
server-rs/crates/api-server/src/match3d/runtime.rs
Normal file
@@ -0,0 +1,37 @@
|
||||
pub(super) fn normalize_match3d_run_status(value: &str) -> &str {
|
||||
match value {
|
||||
"Running" => "running",
|
||||
"Won" => "won",
|
||||
"Failed" => "failed",
|
||||
"Stopped" => "stopped",
|
||||
_ => value,
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn normalize_match3d_item_state(value: &str) -> &str {
|
||||
match value {
|
||||
"InBoard" => "in_board",
|
||||
"InTray" => "in_tray",
|
||||
"Cleared" => "cleared",
|
||||
_ => value,
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn normalize_match3d_failure_reason(value: &str) -> &str {
|
||||
match value {
|
||||
"TimeUp" => "time_up",
|
||||
"TrayFull" => "tray_full",
|
||||
_ => value,
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn normalize_match3d_click_reject_reason(value: &str) -> &str {
|
||||
match value {
|
||||
"RejectedNotClickable" => "item_not_clickable",
|
||||
"RejectedAlreadyMoved" => "item_not_in_board",
|
||||
"RejectedTrayFull" => "tray_full",
|
||||
"VersionConflict" => "snapshot_version_mismatch",
|
||||
"RunFinished" => "run_not_active",
|
||||
_ => value,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user