diff options
author | Wiktor Kwapisiewicz <wiktor@metacode.biz> | 2022-05-06 12:10:08 +0200 |
---|---|---|
committer | Wiktor Kwapisiewicz <wiktor@metacode.biz> | 2022-05-06 12:46:24 +0200 |
commit | 06ab50b50082862c5316a7951ef9b860eef48018 (patch) | |
tree | 602961fa03e3686f45038e29216721b58081dc53 /openpgp/src | |
parent | 18c2f6805cd7878c0974404f45965773ffee09a1 (diff) |
openpgp: Move documentation and warn against armor::Reader::new.
Diffstat (limited to 'openpgp/src')
-rw-r--r-- | openpgp/src/armor.rs | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/openpgp/src/armor.rs b/openpgp/src/armor.rs index c2284dc6..c7c500cd 100644 --- a/openpgp/src/armor.rs +++ b/openpgp/src/armor.rs @@ -607,6 +607,20 @@ impl Default for CSFTransformer { impl<'a> Reader<'a> { /// Constructs a new filter for the given type of data. /// + /// This function is deprecated. Please use + /// [`Reader::from_reader`][]. + pub fn new<R, M>(inner: R, mode: M) -> Self + where R: 'a + Read + Send + Sync, + M: Into<Option<ReaderMode>> + { + Self::from_buffered_reader( + Box::new(buffered_reader::Generic::with_cookie(inner, None, + Default::default())), + mode, Default::default()) + } + + /// Constructs a new `Reader` from the given `io::Read`er. + /// /// [ASCII Armor], designed to protect OpenPGP data in transit, /// has been a source of problems if the armor structure is /// damaged. For example, copying data manually from one program @@ -673,17 +687,6 @@ impl<'a> Reader<'a> { /// # Ok(()) /// # } /// ``` - pub fn new<R, M>(inner: R, mode: M) -> Self - where R: 'a + Read + Send + Sync, - M: Into<Option<ReaderMode>> - { - Self::from_buffered_reader( - Box::new(buffered_reader::Generic::with_cookie(inner, None, - Default::default())), - mode, Default::default()) - } - - /// Creates a `Reader` from an `io::Read`er. pub fn from_reader<R, M>(reader: R, mode: M) -> Self where R: 'a + Read + Send + Sync, M: Into<Option<ReaderMode>> |