From 149b843927a2343172adfb3233d7bc1dc02aeacf Mon Sep 17 00:00:00 2001 From: projectmoon Date: Fri, 1 Jan 2021 22:56:41 +0000 Subject: [PATCH] Remove versioning from data type enum members --- src/models/characters.rs | 12 ++++++------ src/routes/characters.rs | 4 ++-- src/routes/characters/edit.rs | 4 ++-- src/routes/characters/new.rs | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/models/characters.rs b/src/models/characters.rs index dfaf31c..3f39f06 100644 --- a/src/models/characters.rs +++ b/src/models/characters.rs @@ -51,8 +51,8 @@ pub(crate) trait Visibility { #[derive(Debug, Serialize, PartialEq, Clone, Copy, EnumIter, EnumString, sqlx::Type)] #[sqlx(rename_all = "snake_case")] pub enum CharacterDataType { - ChroniclesOfDarknessV1, - ChangelingV1, + ChroniclesOfDarkness, + Changeling, } impl CharacterDataType { @@ -62,13 +62,13 @@ impl CharacterDataType { use prost::Message; use CharacterDataType::*; let data: BytesMut = match self { - ChroniclesOfDarknessV1 => { + ChroniclesOfDarkness => { let sheet = CofdSheet::default_sheet(); let mut buf = BytesMut::with_capacity(std::mem::size_of_val(&sheet)); sheet.encode(&mut buf)?; buf } - ChangelingV1 => { + Changeling => { let sheet = ChangelingSheet::default_sheet(); let mut buf = BytesMut::with_capacity(std::mem::size_of_val(&sheet)); sheet.encode(&mut buf)?; @@ -121,8 +121,8 @@ impl Character { pub fn dyn_deserialize(&self) -> Result, Error> { use CharacterDataType::*; let decoded: Box = match self.data_type { - ChroniclesOfDarknessV1 => Box::new(self.try_deserialize::()?), - ChangelingV1 => Box::new(self.try_deserialize::()?), + ChroniclesOfDarkness => Box::new(self.try_deserialize::()?), + Changeling => Box::new(self.try_deserialize::()?), }; Ok(decoded) diff --git a/src/routes/characters.rs b/src/routes/characters.rs index f2bc09c..d61a960 100644 --- a/src/routes/characters.rs +++ b/src/routes/characters.rs @@ -39,8 +39,8 @@ fn view_character_template(user: &User, character: Character) -> Result