From 1779deedea4cb68c7798f6ee8b4121b33526e782 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 30 Sep 2024 22:28:31 +0200 Subject: set versions to 2.1.0 --- server/protocol/Cargo.toml | 2 +- server/protocol/src/lib.rs | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'server/protocol') diff --git a/server/protocol/Cargo.toml b/server/protocol/Cargo.toml index 2a7a989c..a9210d33 100644 --- a/server/protocol/Cargo.toml +++ b/server/protocol/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hurrycurry-protocol" -version = "0.1.0" +version = "7.3.0" edition = "2021" [dependencies] diff --git a/server/protocol/src/lib.rs b/server/protocol/src/lib.rs index d26d8d18..1acf7997 100644 --- a/server/protocol/src/lib.rs +++ b/server/protocol/src/lib.rs @@ -21,14 +21,24 @@ use bincode::{ }; use glam::{IVec2, Vec2}; use serde::{Deserialize, Serialize}; -use std::{collections::HashSet, fmt::Display}; +use std::{collections::HashSet, fmt::Display, sync::LazyLock}; pub use glam; pub mod movement; pub mod registry; -pub const VERSION: (u32, u32) = (7, 3); +pub static VERSION: LazyLock<(u32, u32)> = LazyLock::new(|| { + ( + env!("CARGO_PKG_VERSION_MAJOR").parse().unwrap(), + env!("CARGO_PKG_VERSION_MINOR").parse().unwrap(), + ) +}); + +#[test] +fn test_version_parse() { + let _ = *VERSION; +} pub const BINCODE_CONFIG: Configuration> = standard().with_limit(); -- cgit v1.2.3-70-g09d2