|
1 |
| -use std::collections::HashSet; |
2 |
| - |
3 | 1 | use pyo3::prelude::*;
|
4 | 2 | use pyo3::types::{PyDict, PyList};
|
5 | 3 |
|
| 4 | +use ahash::AHashSet; |
| 5 | + |
6 | 6 | use crate::build_tools::{py_error, SchemaDict};
|
7 | 7 | use crate::errors::{as_internal, context, err_val_error, ErrorKind, ValResult};
|
8 | 8 | use crate::input::Input;
|
@@ -119,13 +119,13 @@ impl Validator for LiteralSingleIntValidator {
|
119 | 119 |
|
120 | 120 | #[derive(Debug, Clone)]
|
121 | 121 | pub struct LiteralMultipleStringsValidator {
|
122 |
| - expected: HashSet<String>, |
| 122 | + expected: AHashSet<String>, |
123 | 123 | repr: String,
|
124 | 124 | }
|
125 | 125 |
|
126 | 126 | impl LiteralMultipleStringsValidator {
|
127 | 127 | fn new(expected_list: &PyList) -> Option<Self> {
|
128 |
| - let mut expected: HashSet<String> = HashSet::new(); |
| 128 | + let mut expected: AHashSet<String> = AHashSet::new(); |
129 | 129 | let mut repr_args = Vec::new();
|
130 | 130 | for item in expected_list.iter() {
|
131 | 131 | if let Ok(str) = item.extract() {
|
@@ -170,13 +170,13 @@ impl Validator for LiteralMultipleStringsValidator {
|
170 | 170 |
|
171 | 171 | #[derive(Debug, Clone)]
|
172 | 172 | pub struct LiteralMultipleIntsValidator {
|
173 |
| - expected: HashSet<i64>, |
| 173 | + expected: AHashSet<i64>, |
174 | 174 | repr: String,
|
175 | 175 | }
|
176 | 176 |
|
177 | 177 | impl LiteralMultipleIntsValidator {
|
178 | 178 | fn new(expected_list: &PyList) -> Option<Self> {
|
179 |
| - let mut expected: HashSet<i64> = HashSet::new(); |
| 179 | + let mut expected: AHashSet<i64> = AHashSet::new(); |
180 | 180 | let mut repr_args = Vec::new();
|
181 | 181 | for item in expected_list.iter() {
|
182 | 182 | if let Ok(str) = item.extract() {
|
@@ -221,16 +221,16 @@ impl Validator for LiteralMultipleIntsValidator {
|
221 | 221 |
|
222 | 222 | #[derive(Debug, Clone)]
|
223 | 223 | pub struct LiteralGeneralValidator {
|
224 |
| - expected_int: HashSet<i64>, |
225 |
| - expected_str: HashSet<String>, |
| 224 | + expected_int: AHashSet<i64>, |
| 225 | + expected_str: AHashSet<String>, |
226 | 226 | expected_py: Py<PyList>,
|
227 | 227 | repr: String,
|
228 | 228 | }
|
229 | 229 |
|
230 | 230 | impl LiteralGeneralValidator {
|
231 | 231 | fn new(expected: &PyList) -> PyResult<Self> {
|
232 |
| - let mut expected_int = HashSet::new(); |
233 |
| - let mut expected_str = HashSet::new(); |
| 232 | + let mut expected_int = AHashSet::new(); |
| 233 | + let mut expected_str = AHashSet::new(); |
234 | 234 | let py = expected.py();
|
235 | 235 | let expected_py = PyList::empty(py);
|
236 | 236 | let mut repr_args: Vec<String> = Vec::new();
|
|
0 commit comments