diff options
author | Nora Widdecke <nora@sequoia-pgp.org> | 2020-10-09 12:50:00 +0200 |
---|---|---|
committer | Nora Widdecke <nora@sequoia-pgp.org> | 2020-10-09 13:05:49 +0200 |
commit | 86e40dba44c73a5eb6f24f18e0425ac39d1dd287 (patch) | |
tree | 2483383e632cb378dbe67cce7f9f85d3a4bb97fb | |
parent | bd41b17285a66340b917d8aef6ae567889cf47e4 (diff) |
openpgp: Allow HashSet with mutable key type.
- Closes #578.
- Generally, types used as keys of HashSets should not have interior
mutability. We believe this case to be safe, however.
- https://rust-lang.github.io/rust-clippy/master/index.html#mutable_key_type
-rw-r--r-- | openpgp/src/packet/signature.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/openpgp/src/packet/signature.rs b/openpgp/src/packet/signature.rs index b5760d03..ff941f4d 100644 --- a/openpgp/src/packet/signature.rs +++ b/openpgp/src/packet/signature.rs @@ -2175,6 +2175,11 @@ impl crate::packet::Signature { } // Collect subpackets keeping track of the size. + #[allow(clippy::mutable_key_type)] + // In general, the keys of a HashSet should not have interior mutability. + // This particular use should be safe: The hash set is only constructed + // for the merge, we own all objects we put into the set, and we don't + // modify them while they are in the set. let mut acc = std::collections::HashSet::new(); let mut size = 0; |