# HG changeset patch # User alfadur # Date 1577214722 -10800 # Node ID 17ad5d43e820d3a546539f5e58c0c5876eb23532 # Parent 428a0e7da27bc2e637a31f689b20c97a53253635 update subslice pattern to the new syntax diff -r 428a0e7da27b -r 17ad5d43e820 rust/hedgewars-server/src/handlers/inroom.rs --- a/rust/hedgewars-server/src/handlers/inroom.rs Tue Dec 24 21:57:55 2019 +0300 +++ b/rust/hedgewars-server/src/handlers/inroom.rs Tue Dec 24 22:12:02 2019 +0300 @@ -48,10 +48,10 @@ b"M#+LlRrUuDdZzAaSjJ,NpPwtgfhbc12345\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A"; const NON_TIMED_MESSAGES: &[u8] = b"M#hb"; -/*#[cfg(canhazslicepatterns)] +#[cfg(canhazslicepatterns)] fn is_msg_valid(msg: &[u8], team_indices: &[u8]) -> bool { match msg { - [size, typ, body..MAX] => { + [size, typ, body @..] => { VALID_MESSAGES.contains(typ) && match body { [1..=MAX_HEDGEHOGS_PER_TEAM, team, ..] if *typ == b'h' => { @@ -62,7 +62,7 @@ } _ => false, } -}*/ +} fn is_msg_valid(msg: &[u8], _team_indices: &[u8]) -> bool { if let Some(typ) = msg.get(1) {