From 0a01c81c7b5e2d8e47df66c3381ac4b19196ad26 Mon Sep 17 00:00:00 2001 From: Max Inden Date: Sat, 13 Aug 2022 12:46:45 +0200 Subject: [PATCH] misc/multistream-select: Replace msg.get(0) with msg.first() (#2816) --- 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 1cfdcc4b..d1374ef7 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') {