From 7c7489c1dd934b571c3812eae84a6ea0bbfa1bdb Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Mon, 21 Nov 2022 19:23:59 -0800 Subject: [PATCH] Ignore clippy::cast_possible_truncation (pedantic) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit “casting `usize` to `u8` may truncate the value” https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation Signed-off-by: Anders Kaseorg --- src/code_gen.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/code_gen.rs b/src/code_gen.rs index 721600e101..f9f2f98c2d 100644 --- a/src/code_gen.rs +++ b/src/code_gen.rs @@ -963,6 +963,7 @@ impl SourceGenerator { if conversion != ConversionFlag::None as usize { self.p("!")?; + #[allow(clippy::cast_possible_truncation)] let buf = &[conversion as u8]; let c = std::str::from_utf8(buf).unwrap(); self.p(c)?;