mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 02:38:25 +00:00
Update Rust crate rustc-hash to v2 (#12001)
This commit is contained in:
parent
446ad0ba44
commit
53a80a5c11
17 changed files with 78 additions and 105 deletions
|
@ -1,9 +1,8 @@
|
|||
use std::cmp::Ordering;
|
||||
use std::hash::BuildHasherDefault;
|
||||
use std::ops::Deref;
|
||||
|
||||
use bitflags::bitflags;
|
||||
use rustc_hash::FxHashSet;
|
||||
use rustc_hash::{FxBuildHasher, FxHashSet};
|
||||
|
||||
use ruff_python_ast::{
|
||||
self as ast, BoolOp, CmpOp, ConversionFlag, Expr, ExprContext, FStringElement, FStringElements,
|
||||
|
@ -2279,10 +2278,8 @@ impl<'src> Parser<'src> {
|
|||
///
|
||||
/// Report errors for all the duplicate names found.
|
||||
fn validate_arguments(&mut self, arguments: &ast::Arguments) {
|
||||
let mut all_arg_names = FxHashSet::with_capacity_and_hasher(
|
||||
arguments.keywords.len(),
|
||||
BuildHasherDefault::default(),
|
||||
);
|
||||
let mut all_arg_names =
|
||||
FxHashSet::with_capacity_and_hasher(arguments.keywords.len(), FxBuildHasher);
|
||||
|
||||
for (name, range) in arguments
|
||||
.keywords
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
use std::fmt::Display;
|
||||
use std::hash::BuildHasherDefault;
|
||||
|
||||
use rustc_hash::FxHashSet;
|
||||
use rustc_hash::{FxBuildHasher, FxHashSet};
|
||||
|
||||
use ruff_python_ast::{
|
||||
self as ast, ExceptHandler, Expr, ExprContext, IpyEscapeKind, Operator, Stmt, WithItem,
|
||||
|
@ -3264,7 +3263,7 @@ impl<'src> Parser<'src> {
|
|||
/// Report errors for all the duplicate names found.
|
||||
fn validate_parameters(&mut self, parameters: &ast::Parameters) {
|
||||
let mut all_arg_names =
|
||||
FxHashSet::with_capacity_and_hasher(parameters.len(), BuildHasherDefault::default());
|
||||
FxHashSet::with_capacity_and_hasher(parameters.len(), FxBuildHasher);
|
||||
|
||||
for parameter in parameters {
|
||||
let range = parameter.name().range();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue