diff options
| author | Fuwn <[email protected]> | 2021-06-05 23:05:53 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-06-05 23:05:53 -0700 |
| commit | 344d9808a83fabc94536f0b2503f9dfcc250cbad (patch) | |
| tree | 4dc0d03a38b61ab8d4fa8195e8cd13e3ce433e34 | |
| parent | refactor(whirl_server): create property list type (diff) | |
| download | whirl-344d9808a83fabc94536f0b2503f9dfcc250cbad.tar.xz whirl-344d9808a83fabc94536f0b2503f9dfcc250cbad.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(), }); |