Skip to content

Commit

Permalink
Incorporate Clippy reported suggestion
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
d-e-s-o committed Jan 10, 2025
1 parent 1b994fd commit 225f3ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/kernel/bpf/prog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl FromStr for BpfTag {
type Err = ();

fn from_str(s: &str) -> Result<Self, Self::Err> {
if s.as_bytes().len() != 2 * size_of::<BpfTag>() {
if s.len() != 2 * size_of::<BpfTag>() {
return Err(())
}

Expand Down

0 comments on commit 225f3ef

Please sign in to comment.