diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-01-29 18:42:14 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-01-29 18:42:14 +0100 |
commit | e5ee74691f21f46bdc30556a6b67ecf5f9532ece (patch) | |
tree | 7219e4926d8037da432d4d6027bd5a713f5e4989 /openpgp/src/parse/partial_body.rs | |
parent | 18fa4d0be6285f68b9a163c52bd65955fb3a795b (diff) |
buffered-reader: Use the new as_boxed method.
- This cleanly avoids creating a linked list of references on the
stack that grows every time we call into_inner.
Diffstat (limited to 'openpgp/src/parse/partial_body.rs')
-rw-r--r-- | openpgp/src/parse/partial_body.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/openpgp/src/parse/partial_body.rs b/openpgp/src/parse/partial_body.rs index 222e2894..202b1a53 100644 --- a/openpgp/src/parse/partial_body.rs +++ b/openpgp/src/parse/partial_body.rs @@ -386,7 +386,7 @@ impl<T: BufferedReader<Cookie>> BufferedReader<Cookie> fn into_inner<'b>(self: Box<Self>) -> Option<Box<dyn BufferedReader<Cookie> + 'b>> where Self: 'b { - Some(Box::new(self.reader)) + Some(self.reader.as_boxed()) } fn cookie_set(&mut self, cookie: Cookie) -> Cookie { |