summaryrefslogtreecommitdiff
path: root/server/protocol/src/lib.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-09-30 22:28:31 +0200
committermetamuffin <metamuffin@disroot.org>2024-09-30 22:28:41 +0200
commit1779deedea4cb68c7798f6ee8b4121b33526e782 (patch)
treebe92737bae011b2caea7e573af894d498579c6a4 /server/protocol/src/lib.rs
parent96a1a6f647a729b71aed7e2d562ae0ab69f670c7 (diff)
downloadhurrycurry-1779deedea4cb68c7798f6ee8b4121b33526e782.tar
hurrycurry-1779deedea4cb68c7798f6ee8b4121b33526e782.tar.bz2
hurrycurry-1779deedea4cb68c7798f6ee8b4121b33526e782.tar.zst
set versions to 2.1.0v2.1.0
Diffstat (limited to 'server/protocol/src/lib.rs')
-rw-r--r--server/protocol/src/lib.rs14
1 files changed, 12 insertions, 2 deletions
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<LittleEndian, Varint, Limit<4096>> =
standard().with_limit();