[ruff] itertools.starmap(..., zip(...)) (RUF058) (#15483)

Co-authored-by: Micha Reiser <micha@reiser.io>
This commit is contained in:
InSync 2025-01-16 21:18:12 +07:00 committed by GitHub
parent c20255abe4
commit aed0bf1c11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 490 additions and 22 deletions

View file

@ -3892,6 +3892,18 @@ impl Arguments {
let keywords = self.keywords.iter().map(ArgOrKeyword::Keyword);
args.merge_by(keywords, |left, right| left.start() < right.start())
}
pub fn inner_range(&self) -> TextRange {
TextRange::new(self.l_paren_range().end(), self.r_paren_range().start())
}
pub fn l_paren_range(&self) -> TextRange {
TextRange::at(self.start(), '('.text_len())
}
pub fn r_paren_range(&self) -> TextRange {
TextRange::new(self.end() - ')'.text_len(), self.end())
}
}
/// An AST node used to represent a sequence of type parameters.