diff options
| author | Fuwn <[email protected]> | 2021-06-05 23:04:24 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-06-05 23:04:24 -0700 |
| commit | 47878a1414a17c4c4e5b7c5f1b34c6a504709469 (patch) | |
| tree | ced2216e791f09bb4e54c5f8c429d49cddf61c42 /crates/whirl_server/src/net | |
| parent | docs(whirl_server::net::constants): portage notice (diff) | |
| download | whirl-47878a1414a17c4c4e5b7c5f1b34c6a504709469.tar.xz whirl-47878a1414a17c4c4e5b7c5f1b34c6a504709469.zip | |
refactor(whirl_server): create property list type
Diffstat (limited to 'crates/whirl_server/src/net')
| -rw-r--r-- | crates/whirl_server/src/net/converter.rs | 4 | ||||
| -rw-r--r-- | crates/whirl_server/src/net/mod.rs | 2 | ||||
| -rw-r--r-- | crates/whirl_server/src/net/property_parser.rs | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/crates/whirl_server/src/net/converter.rs b/crates/whirl_server/src/net/converter.rs index 1b36e78..f8a5188 100644 --- a/crates/whirl_server/src/net/converter.rs +++ b/crates/whirl_server/src/net/converter.rs @@ -8,14 +8,14 @@ use crate::{ cmd::constants::Command, net::{ constants::{PROPACCESS_POSSESS, PROPFLAG_DBSTORE}, - structure::NetworkProperty, + PropertyList, }, }; pub fn property_list_to_bytes( command_id: i32, obj_id: i32, - mut property_list: Vec<NetworkProperty>, + mut property_list: PropertyList, ) -> Vec<u8> { let mut command = BytesMut::new(); diff --git a/crates/whirl_server/src/net/mod.rs b/crates/whirl_server/src/net/mod.rs index afa45c8..27e4cf5 100644 --- a/crates/whirl_server/src/net/mod.rs +++ b/crates/whirl_server/src/net/mod.rs @@ -5,3 +5,5 @@ pub mod constants; pub mod converter; pub mod property_parser; pub mod structure; + +type PropertyList = Vec<crate::net::structure::NetworkProperty>; diff --git a/crates/whirl_server/src/net/property_parser.rs b/crates/whirl_server/src/net/property_parser.rs index ac363d2..9554658 100644 --- a/crates/whirl_server/src/net/property_parser.rs +++ b/crates/whirl_server/src/net/property_parser.rs @@ -7,7 +7,7 @@ use crate::net::structure::NetworkProperty; /// Iterate over a network property in the form of bytes (Vec<u8>) and return a /// list of human-readable properties. -pub fn parse_network_property(mut data: Vec<u8>) -> Vec<NetworkProperty> { +pub fn parse_network_property(mut data: Vec<u8>) -> crate::net::PropertyList { let mut property_list = vec![]; // Iterate over all network properties |