Gateway: Move from RwLock<HashMap> to DashMap

Moves to the faster dashmap in the Songbird management struct, as the final v4 brought back the `entry` API that I was needing to use it safely.

Also handles some new clippy lints.
This commit is contained in:
Kyle Simpson
2021-01-26 14:23:07 +00:00
parent 658fd830c1
commit a0e905a83f
3 changed files with 15 additions and 11 deletions

View File

@@ -131,9 +131,9 @@ impl CryptoMode {
let (tag_bytes, data_bytes) = body_remaining.split_at_mut(body_start);
let tag = Tag::from_slice(tag_bytes);
Ok(cipher
cipher
.decrypt_in_place_detached(nonce_slice, b"", data_bytes, tag)
.map(|_| (body_start, body_tail))?)
.map(|_| (body_start, body_tail))
}
/// Encrypts a Discord RT(C)P packet using the given key.