replace std::mem::replace with std::mem::take according to clippy sugguestion (#1611)

Co-authored-by: frost.wong <happyhackerwqc@foxmail.com>
This commit is contained in:
Frost Wong
2025-01-26 06:09:26 +08:00
committed by GitHub
parent ac0da11157
commit e36453ac25

View File

@ -63,7 +63,7 @@ impl HashMapChaining {
/* 扩容哈希表 */
fn extend(&mut self) {
// 暂存原哈希表
let buckets_tmp = std::mem::replace(&mut self.buckets, vec![]);
let buckets_tmp = std::mem::take(&mut self.buckets);
// 初始化扩容后的新哈希表
self.capacity *= self.extend_ratio;