|
1 | 1 | use std::{
|
2 |
| - borrow::Cow, cell::RefCell, collections::hash_map::Entry, hash::{Hash, Hasher}, sync::{ |
| 2 | + borrow::Cow, |
| 3 | + cell::RefCell, |
| 4 | + collections::hash_map::Entry, |
| 5 | + hash::{Hash, Hasher}, |
| 6 | + sync::{ |
3 | 7 | atomic::{AtomicBool, Ordering},
|
4 | 8 | Arc, Mutex, MutexGuard, OnceLock,
|
5 |
| - } |
| 9 | + }, |
6 | 10 | };
|
7 | 11 |
|
8 | 12 | use rustc_hash::FxHashMap as HashMap;
|
@@ -406,9 +410,7 @@ impl<T: Source> StreamChunks for ReplaceSource<T> {
|
406 | 410 | let mut name_mapping = name_mapping.borrow_mut();
|
407 | 411 | let len = name_mapping.len() as u32;
|
408 | 412 | let global_index = match name_mapping.entry(name.to_string()) {
|
409 |
| - Entry::Occupied(entry) => { |
410 |
| - *entry.get() |
411 |
| - }, |
| 413 | + Entry::Occupied(entry) => *entry.get(), |
412 | 414 | Entry::Vacant(entry) => {
|
413 | 415 | entry.insert(len);
|
414 | 416 | on_name.borrow_mut()(len, name);
|
@@ -581,9 +583,7 @@ impl<T: Source> StreamChunks for ReplaceSource<T> {
|
581 | 583 | let mut name_mapping = name_mapping.borrow_mut();
|
582 | 584 | let len = name_mapping.len() as u32;
|
583 | 585 | let global_index = match name_mapping.entry(name.to_string()) {
|
584 |
| - Entry::Occupied(entry) => { |
585 |
| - *entry.get() |
586 |
| - }, |
| 586 | + Entry::Occupied(entry) => *entry.get(), |
587 | 587 | Entry::Vacant(entry) => {
|
588 | 588 | entry.insert(len);
|
589 | 589 | on_name.borrow_mut()(len, name);
|
|
0 commit comments