From 0dc39121c82a0679adacf1e4fa7afc30343f5fb1 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 17 Dec 2024 20:06:46 -0800 Subject: [PATCH] submissions-api: need stupid dependency to do this --- validation/Cargo.lock | 1 + validation/api/Cargo.lock | 12 ++++++++++++ validation/api/Cargo.toml | 1 + validation/api/src/internal.rs | 2 +- 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/validation/Cargo.lock b/validation/Cargo.lock index 2f6b714..82ab92b 100644 --- a/validation/Cargo.lock +++ b/validation/Cargo.lock @@ -1809,6 +1809,7 @@ dependencies = [ "reqwest", "serde", "serde_json", + "serde_repr", "url", ] diff --git a/validation/api/Cargo.lock b/validation/api/Cargo.lock index df4b1fc..9033cf0 100644 --- a/validation/api/Cargo.lock +++ b/validation/api/Cargo.lock @@ -895,6 +895,17 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_repr" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -957,6 +968,7 @@ dependencies = [ "reqwest", "serde", "serde_json", + "serde_repr", "url", ] diff --git a/validation/api/Cargo.toml b/validation/api/Cargo.toml index b8cc933..eb75b1a 100644 --- a/validation/api/Cargo.toml +++ b/validation/api/Cargo.toml @@ -14,6 +14,7 @@ authors = ["Rhys Lloyd "] reqwest = { version = "0", features = ["json"] } serde = { version = "1", features = ["derive"] } serde_json = "1" +serde_repr = "0.1.19" url = "2" [features] diff --git a/validation/api/src/internal.rs b/validation/api/src/internal.rs index daaf37c..dc36912 100644 --- a/validation/api/src/internal.rs +++ b/validation/api/src/internal.rs @@ -31,7 +31,7 @@ pub struct ScriptIDResponse{ pub ID:ScriptID, } -#[derive(serde::Serialize,serde::Deserialize)] +#[derive(serde_repr::Serialize_repr,serde_repr::Deserialize_repr)] #[repr(i32)] pub enum Policy{ None=0, // not yet reviewed