mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 10:49:50 +00:00
Use #[expect(lint)]
over #[allow(lint)]
where possible (#17822)
This commit is contained in:
parent
8535af8516
commit
fa628018b2
148 changed files with 221 additions and 268 deletions
|
@ -241,7 +241,7 @@ where
|
|||
Ok((format_type, c))
|
||||
}
|
||||
|
||||
#[allow(clippy::cast_possible_wrap)]
|
||||
#[expect(clippy::cast_possible_wrap)]
|
||||
fn parse_quantity<T, I>(iter: &mut ParseIter<I>) -> Result<Option<CFormatQuantity>, ParsingError>
|
||||
where
|
||||
T: Into<char> + Copy,
|
||||
|
|
|
@ -103,11 +103,7 @@ impl std::fmt::Display for StrRepr<'_, '_> {
|
|||
impl UnicodeEscape<'_> {
|
||||
const REPR_RESERVED_LEN: usize = 2; // for quotes
|
||||
|
||||
#[allow(
|
||||
clippy::cast_possible_wrap,
|
||||
clippy::cast_possible_truncation,
|
||||
clippy::cast_sign_loss
|
||||
)]
|
||||
#[expect(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
|
||||
pub fn repr_layout(source: &str, preferred_quote: Quote) -> EscapeLayout {
|
||||
Self::output_layout_with_checker(source, preferred_quote, |a, b| {
|
||||
Some((a as isize).checked_add(b as isize)? as usize)
|
||||
|
@ -265,11 +261,7 @@ impl<'a> AsciiEscape<'a> {
|
|||
}
|
||||
|
||||
impl AsciiEscape<'_> {
|
||||
#[allow(
|
||||
clippy::cast_possible_wrap,
|
||||
clippy::cast_possible_truncation,
|
||||
clippy::cast_sign_loss
|
||||
)]
|
||||
#[expect(clippy::cast_possible_wrap, clippy::cast_sign_loss)]
|
||||
pub fn repr_layout(source: &[u8], preferred_quote: Quote) -> EscapeLayout {
|
||||
Self::output_layout_with_checker(source, preferred_quote, 3, |a, b| {
|
||||
Some((a as isize).checked_add(b as isize)? as usize)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue