replace std::mem::replace with std::mem::take according to clippy sugguestion (#1611)
Some checks failed
Python / Python 3.10 on macos-latest (push) Has been cancelled
Python / Python 3.11 on macos-latest (push) Has been cancelled
Python / Python 3.10 on ubuntu-latest (push) Has been cancelled
Python / Python 3.11 on ubuntu-latest (push) Has been cancelled
Python / Python 3.10 on windows-latest (push) Has been cancelled
Python / Python 3.11 on windows-latest (push) Has been cancelled
Rust / build (macos-latest) (push) Has been cancelled
Rust / build (ubuntu-latest) (push) Has been cancelled
Rust / build (windows-latest) (push) Has been cancelled

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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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;