rust/hedgewars-server/src/protocol/messages.rs
changeset 15817 40929af15167
parent 15554 f1205f33bf5b
--- a/rust/hedgewars-server/src/protocol/messages.rs	Thu Jun 17 19:32:26 2021 +0200
+++ b/rust/hedgewars-server/src/protocol/messages.rs	Sat Jun 19 17:48:10 2021 +0300
@@ -213,7 +213,7 @@
             Scheme(n, s) if s.is_empty() => ("SCHEME".to_string(), vec![n.to_string()]),
             Scheme(n, s) => ("SCHEME".to_string(), {
                 let mut v = vec![n.to_string()];
-                v.extend(s.clone().into_iter());
+                v.extend(s.clone());
                 v
             }),
             Script(s) => ("SCRIPT".to_string(), vec![s.to_string()]),
@@ -261,12 +261,6 @@
     };
 }
 
-#[cfg(test)]
-macro_rules! several {
-    [$part: expr] => { once($part) };
-    [$part: expr, $($other: expr),*] => { once($part).chain(several![$($other),*]) };
-}
-
 impl HwProtocolMessage {
     /** Converts the message to a raw `String`, which can be sent over the network.
      *
@@ -330,7 +324,7 @@
                 info.difficulty,
                 info.hedgehogs
                     .iter()
-                    .flat_map(|h| several![&h.name[..], &h.hat[..]])
+                    .flat_map(|h| [&h.name[..], &h.hat[..]])
                     .collect::<Vec<_>>()
                     .join("\n")
             ],