mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-26 20:10:09 +00:00
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:
parent
ae90eccb7f
commit
7c7489c1dd
1 changed files with 1 additions and 0 deletions
|
@ -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)?;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue