From aea7ba1a94ace78b1011b202e9884abccdab4012 Mon Sep 17 00:00:00 2001 From: Wiktor Kwapisiewicz Date: Thu, 9 Jun 2022 09:27:03 +0200 Subject: openpgp: Deprecate DataFormat::MIME - Deprecate the enum variant in preparation for v2 removal to let API clients adjust their code as early as possible. - Update NEWS. - See #863. --- openpgp/NEWS | 1 + openpgp/src/types/mod.rs | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'openpgp') diff --git a/openpgp/NEWS b/openpgp/NEWS index fd6611d0..035d6721 100644 --- a/openpgp/NEWS +++ b/openpgp/NEWS @@ -8,6 +8,7 @@ - TryFrom for Unknown ** Deprecated functionality - Error::UnsupportedCert, use Error::UnsupportedCert2 instead + - DataFormat::MIME, no replacement, see #863 for details * Changes in 1.9.0 ** New functionality - AEADAlgorithm::nonce_size replaces AEADAlgorithm::iv_size diff --git a/openpgp/src/types/mod.rs b/openpgp/src/types/mod.rs index f3c80a4d..7e7c3032 100644 --- a/openpgp/src/types/mod.rs +++ b/openpgp/src/types/mod.rs @@ -1600,6 +1600,7 @@ pub enum DataFormat { /// This is defined in [Section 5.10 of RFC4880bis]. /// /// [Section 5.10 of RFC4880bis]: https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-05#section-5.10 + #[deprecated(since = "1.10.0", note = "Do not use as semantics are unclear")] MIME, /// Unknown format specifier. @@ -1626,6 +1627,7 @@ impl From for DataFormat { 'b' => Binary, 't' => Text, 'u' => Unicode, + #[allow(deprecated)] 'm' => MIME, c => Unknown(c), } @@ -1645,6 +1647,7 @@ impl From for char { Binary => 'b', Text => 't', Unicode => 'u', + #[allow(deprecated)] MIME => 'm', Unknown(c) => c, } @@ -1661,6 +1664,7 @@ impl fmt::Display for DataFormat { f.write_str("Text data"), Unicode => f.write_str("Text data (UTF-8)"), + #[allow(deprecated)] MIME => f.write_str("MIME message body part"), Unknown(c) => -- cgit v1.2.3