mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 21:05:08 +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
|
@ -30,7 +30,7 @@ pub fn find_only_token_in_range(
|
|||
let token = tokens.next().expect("Expected a token");
|
||||
debug_assert_eq!(token.kind(), token_kind);
|
||||
let mut tokens = tokens.skip_while(|token| token.kind == SimpleTokenKind::LParen);
|
||||
#[allow(clippy::debug_assert_with_mut_call)]
|
||||
#[expect(clippy::debug_assert_with_mut_call)]
|
||||
{
|
||||
debug_assert_eq!(tokens.next(), None);
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ pub fn lines_after_ignoring_trivia(offset: TextSize, code: &str) -> u32 {
|
|||
|
||||
/// Counts the empty lines after `offset`, ignoring any trailing trivia on the same line as
|
||||
/// `offset`.
|
||||
#[allow(clippy::cast_possible_truncation)]
|
||||
#[expect(clippy::cast_possible_truncation)]
|
||||
pub fn lines_after_ignoring_end_of_line_trivia(offset: TextSize, code: &str) -> u32 {
|
||||
// SAFETY: We don't support files greater than 4GB, so casting to u32 is safe.
|
||||
SimpleTokenizer::starts_at(offset, code)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue