diff options
| author | Fuwn <[email protected]> | 2024-06-03 15:37:20 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-06-03 15:37:20 +0000 |
| commit | 967774fc048b9d0738fbd13998ed77b6b70effa2 (patch) | |
| tree | e0f9d650a221476852005eeaac96224584a3a76a /crates/whirl_server/src/hub.rs | |
| parent | format: rustfmt with new rules (diff) | |
| download | whirl-967774fc048b9d0738fbd13998ed77b6b70effa2.tar.xz whirl-967774fc048b9d0738fbd13998ed77b6b70effa2.zip | |
refactor(crates): update idioms
Diffstat (limited to 'crates/whirl_server/src/hub.rs')
| -rw-r--r-- | crates/whirl_server/src/hub.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/whirl_server/src/hub.rs b/crates/whirl_server/src/hub.rs index af4e656..f1a8120 100644 --- a/crates/whirl_server/src/hub.rs +++ b/crates/whirl_server/src/hub.rs @@ -70,7 +70,7 @@ impl Server for Hub { Some(Ok(msg)) => { // trace!("got some bytes: {:?}", &msg); for msg in parse_commands_from_packet(msg) { - match num_traits::FromPrimitive::from_i32(msg.get(2).unwrap().to_owned() as i32) { + match num_traits::FromPrimitive::from_i32(i32::from(msg.get(2).unwrap().to_owned())) { Some(Command::PropReq) => { debug!("received property request from client"); @@ -79,9 +79,9 @@ impl Server for Hub { trace!("sent property update to client"); } Some(Command::SessInit) => { - username = (*crate::net::property_list::PropertyList::from_bytes(msg[3..] + username = crate::net::property_list::PropertyList::from_bytes(msg[3..] .to_vec()) - .find(VAR_USERNAME)).value.to_string(); + .find(VAR_USERNAME).value.to_string(); debug!("received session initialization from {}", username); @@ -142,7 +142,7 @@ impl Server for Hub { { state.lock().await.broadcast(&Text { - sender: (&*username).to_string(), + sender: (*username).to_string(), content: text.content.clone(), }.create()).await; } |