diff options
| author | Fuwn <[email protected]> | 2021-06-05 23:05:53 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-06-05 23:05:53 +0000 |
| commit | 1dcf813be7d8b47f046363eb1e1706409de2c959 (patch) | |
| tree | d8ad6ced960db3024c7870d4f3bc73cb81fad0d9 | |
| parent | refactor(whirl_server): create property list type (diff) | |
| download | whirl-1dcf813be7d8b47f046363eb1e1706409de2c959.tar.xz whirl-1dcf813be7d8b47f046363eb1e1706409de2c959.zip | |
refactor(whirl_server): remove single imports
| -rw-r--r-- | crates/whirl_server/src/net/property_parser.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/crates/whirl_server/src/net/property_parser.rs b/crates/whirl_server/src/net/property_parser.rs index 9554658..9e04d1c 100644 --- a/crates/whirl_server/src/net/property_parser.rs +++ b/crates/whirl_server/src/net/property_parser.rs @@ -1,10 +1,6 @@ // Copyleft (ɔ) 2021-2021 The Whirlsplash Collective // SPDX-License-Identifier: GPL-3.0-only -use std::str::from_utf8; - -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>) -> crate::net::PropertyList { @@ -22,9 +18,9 @@ pub fn parse_network_property(mut data: Vec<u8>) -> crate::net::PropertyList { // } let property_length = data[1] + 2; - property_list.push(NetworkProperty { + property_list.push(crate::net::structure::NetworkProperty { prop_id: i32::from(data[0]), - value: from_utf8(&data[2..data[1] as usize + 2]) + value: std::str::from_utf8(&data[2..data[1] as usize + 2]) .unwrap() .to_string(), }); |