summaryrefslogtreecommitdiffstats
path: root/openpgp
diff options
context:
space:
mode:
authorWiktor Kwapisiewicz <wiktor@metacode.biz>2022-06-09 09:27:03 +0200
committerWiktor Kwapisiewicz <wiktor@metacode.biz>2022-06-09 12:47:15 +0200
commitaea7ba1a94ace78b1011b202e9884abccdab4012 (patch)
tree30ba87e0d2161d9f683d06deb6caaa32dfd6ce22 /openpgp
parentf4417de86b2824424d7a625d713117d8587e1869 (diff)
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.
Diffstat (limited to 'openpgp')
-rw-r--r--openpgp/NEWS1
-rw-r--r--openpgp/src/types/mod.rs4
2 files changed, 5 insertions, 0 deletions
diff --git a/openpgp/NEWS b/openpgp/NEWS
index fd6611d0..035d6721 100644
--- a/openpgp/NEWS
+++ b/openpgp/NEWS
@@ -8,6 +8,7 @@
- TryFrom<Packet> 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<char> for DataFormat {
'b' => Binary,
't' => Text,
'u' => Unicode,
+ #[allow(deprecated)]
'm' => MIME,
c => Unknown(c),
}
@@ -1645,6 +1647,7 @@ impl From<DataFormat> 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) =>