From dfebd1d5a1b38e731eb4c3e3ca43c81554d8e23c Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Tue, 31 Jan 2023 03:12:23 +0100 Subject: [PATCH] move config --- kubi-shared/src/lib.rs | 5 +++++ kubi-shared/src/networking/client.rs | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/kubi-shared/src/lib.rs b/kubi-shared/src/lib.rs index dd0e7a5..8fb7339 100644 --- a/kubi-shared/src/lib.rs +++ b/kubi-shared/src/lib.rs @@ -2,3 +2,8 @@ pub mod blocks; pub mod networking; pub mod worldgen; pub mod chunk; + +pub(crate) const BINCODE_CONFIG: bincode::config::Configuration = bincode::config::standard() + .with_little_endian() + .with_variable_int_encoding() + .skip_fixed_array_length(); diff --git a/kubi-shared/src/networking/client.rs b/kubi-shared/src/networking/client.rs index 863715f..82d0ddd 100644 --- a/kubi-shared/src/networking/client.rs +++ b/kubi-shared/src/networking/client.rs @@ -1,10 +1,7 @@ use std::net::{UdpSocket, SocketAddr}; use super::messages::ClientToServerMessage; -const BINCODE_CONFIG: bincode::config::Configuration = bincode::config::standard() - .with_little_endian() - .with_variable_int_encoding() - .skip_fixed_array_length(); +use crate::BINCODE_CONFIG; pub struct Client { socket: UdpSocket