From 225f3ef94f6bfa61618954015042d10e869c9997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20M=C3=BCller?= Date: Fri, 10 Jan 2025 09:41:51 -0800 Subject: [PATCH] Incorporate Clippy reported suggestion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clippy complains that we are using str.as_bytes().len() when we could be using str.len(). Point taken. Adjust the code accordingly. Signed-off-by: Daniel Müller --- src/kernel/bpf/prog.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kernel/bpf/prog.rs b/src/kernel/bpf/prog.rs index d7567a1f..eaf6957e 100644 --- a/src/kernel/bpf/prog.rs +++ b/src/kernel/bpf/prog.rs @@ -63,7 +63,7 @@ impl FromStr for BpfTag { type Err = (); fn from_str(s: &str) -> Result { - if s.as_bytes().len() != 2 * size_of::() { + if s.len() != 2 * size_of::() { return Err(()) }