diff --git a/clippy_lints/src/endian_bytes.rs b/clippy_lints/src/endian_bytes.rs index 8328531deff..bc7dd8534c3 100644 --- a/clippy_lints/src/endian_bytes.rs +++ b/clippy_lints/src/endian_bytes.rs @@ -95,7 +95,7 @@ fn as_lint(&self) -> &'static Lint { } fn as_name(&self, prefix: &Prefix) -> &str { - let index = if matches!(prefix, Prefix::From) { 0 } else { 1 }; + let index = usize::from(matches!(prefix, Prefix::To)); match self { LintKind::Host => HOST_NAMES[index],