From 04a30fbe88c7741be90d79375be2d797619c3367 Mon Sep 17 00:00:00 2001 From: Max Inden Date: Sat, 13 Aug 2022 11:38:38 +0900 Subject: [PATCH] misc/multistream-select: Replace msg.get(0) with msg.first() --- misc/multistream-select/src/protocol.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/multistream-select/src/protocol.rs b/misc/multistream-select/src/protocol.rs index 1cfdcc4b588..d1374ef7495 100644 --- a/misc/multistream-select/src/protocol.rs +++ b/misc/multistream-select/src/protocol.rs @@ -179,7 +179,7 @@ impl Message { // If it starts with a `/`, ends with a line feed without any // other line feeds in-between, it must be a protocol name. - if msg.get(0) == Some(&b'/') + if msg.first() == Some(&b'/') && msg.last() == Some(&b'\n') && !msg[..msg.len() - 1].contains(&b'\n') {