diff options
author | Wiktor Kwapisiewicz <wiktor@metacode.biz> | 2023-05-30 12:03:15 +0200 |
---|---|---|
committer | Wiktor Kwapisiewicz <wiktor@metacode.biz> | 2023-06-06 10:37:51 +0200 |
commit | f5f9b14a304321816526c30ce98edbd6535df9c4 (patch) | |
tree | ccc0f752f9e1ea1037bd4f37a59a52387cd9e7fb /openpgp/src/crypto | |
parent | 4f3d260a013835a8ab0b2f15f45e22ca4678ab24 (diff) |
buffered_reader: Introduce `into_boxed` and deprecate `as_boxed`.
- According to the Rust API Guidelines, a conversion function taking
self should be called `into_*` if the self is not Copy, so this
function should be named `into_boxed`.
- Deprecate old function not to break the API.
- Update all references in the code.
- Fixes https://gitlab.com/sequoia-pgp/sequoia/-/issues/781
Diffstat (limited to 'openpgp/src/crypto')
-rw-r--r-- | openpgp/src/crypto/aead.rs | 2 | ||||
-rw-r--r-- | openpgp/src/crypto/symmetric.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/openpgp/src/crypto/aead.rs b/openpgp/src/crypto/aead.rs index b6fcc578..ae81cbf7 100644 --- a/openpgp/src/crypto/aead.rs +++ b/openpgp/src/crypto/aead.rs @@ -571,7 +571,7 @@ impl<'a, S: Schedule> BufferedReader<Cookie> for BufferedReaderDecryptor<'a, S> fn into_inner<'b>(self: Box<Self>) -> Option<Box<dyn BufferedReader<Cookie> + 'b>> where Self: 'b { - Some(self.reader.into_reader().source.as_boxed()) + Some(self.reader.into_reader().source.into_boxed()) } fn cookie_set(&mut self, cookie: Cookie) -> Cookie { diff --git a/openpgp/src/crypto/symmetric.rs b/openpgp/src/crypto/symmetric.rs index ea4beb11..0652497c 100644 --- a/openpgp/src/crypto/symmetric.rs +++ b/openpgp/src/crypto/symmetric.rs @@ -264,7 +264,7 @@ impl<'a> BufferedReader<Cookie> for BufferedReaderDecryptor<'a> { fn into_inner<'b>(self: Box<Self>) -> Option<Box<dyn BufferedReader<Cookie> + 'b>> where Self: 'b { - Some(self.reader.into_reader().source.as_boxed()) + Some(self.reader.into_reader().source.into_boxed()) } fn cookie_set(&mut self, cookie: Cookie) -> Cookie { |