Ignore clippy::cast_possible_truncation (pedantic)

“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 <andersk@mit.edu>
This commit is contained in:
Anders Kaseorg 2022-11-21 19:23:59 -08:00 committed by Charlie Marsh
parent ae90eccb7f
commit 7c7489c1dd

View file

@ -963,6 +963,7 @@ impl SourceGenerator {
if conversion != ConversionFlag::None as usize { if conversion != ConversionFlag::None as usize {
self.p("!")?; self.p("!")?;
#[allow(clippy::cast_possible_truncation)]
let buf = &[conversion as u8]; let buf = &[conversion as u8];
let c = std::str::from_utf8(buf).unwrap(); let c = std::str::from_utf8(buf).unwrap();
self.p(c)?; self.p(c)?;