summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-03-18 14:36:54 +0100
committerJustus Winter <justus@sequoia-pgp.org>2020-03-20 16:08:02 +0100
commit133a299f6f58f72bb278cf3bb24d6c4b99e112cb (patch)
treed038542a2339472a0a3e70f6e381906f564038b1
parentb4d177ff4390c5fc349c3a3bf55e55dd363b36a1 (diff)
openpgp: Drop Container::body_mut().
- This prevents mutation of packet bodies, avoiding the need to recompute the body digest on demand after mutation. This avoids the need for interior mutability, and avoids a lot of complexity for a questionable use case.
-rw-r--r--openpgp/src/packet/container.rs10
1 files changed, 0 insertions, 10 deletions
diff --git a/openpgp/src/packet/container.rs b/openpgp/src/packet/container.rs
index a3e432c0..185659bb 100644
--- a/openpgp/src/packet/container.rs
+++ b/openpgp/src/packet/container.rs
@@ -236,11 +236,6 @@ impl Container {
crate::fmt::hex::encode(&self.body_digest)
}
- pub(crate) // For parse.rs
- fn body_mut(&mut self) -> &mut Vec<u8> {
- &mut self.body
- }
-
// Converts an indentation level to whitespace.
fn indent(depth: usize) -> &'static str {
use std::cmp;
@@ -282,11 +277,6 @@ macro_rules! the_common_container_forwards {
self.container.body()
}
- /// Gets a mutable reference to the this packet's body.
- pub fn body_mut(&mut self) -> &mut Vec<u8> {
- self.container.body_mut()
- }
-
/// Sets the this packet's body.
pub fn set_body(&mut self, data: Vec<u8>) -> Vec<u8> {
self.container.set_body(data)