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/parse/stream.rs | |
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/parse/stream.rs')
-rw-r--r-- | openpgp/src/parse/stream.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/openpgp/src/parse/stream.rs b/openpgp/src/parse/stream.rs index b59005e7..7a188bc4 100644 --- a/openpgp/src/parse/stream.rs +++ b/openpgp/src/parse/stream.rs @@ -1616,19 +1616,19 @@ impl<'a, H: VerificationHelper> DetachedVerifier<'a, H> { /// Verifies the given data. pub fn verify_reader<R: io::Read + Send + Sync>(&mut self, reader: R) -> Result<()> { self.verify(buffered_reader::Generic::with_cookie( - reader, None, Default::default()).as_boxed()) + reader, None, Default::default()).into_boxed()) } /// Verifies the given data. pub fn verify_file<P: AsRef<Path>>(&mut self, path: P) -> Result<()> { self.verify(buffered_reader::File::with_cookie( - path, Default::default())?.as_boxed()) + path, Default::default())?.into_boxed()) } /// Verifies the given data. pub fn verify_bytes<B: AsRef<[u8]>>(&mut self, buf: B) -> Result<()> { self.verify(buffered_reader::Memory::with_cookie( - buf.as_ref(), Default::default()).as_boxed()) + buf.as_ref(), Default::default()).into_boxed()) } /// Verifies the given data. |