macros: Use a nicer syntax when declaring attributes.
The previous version had a => required|optional|default token, this was duplicating information for Option types and didn’t look very good. This new version looks like a type, which can be either Required<_>, Option<_> or Default<_>, and means the same thing.
This commit is contained in:
parent
f2c3f45a6f
commit
bcd42a26e3
27 changed files with 162 additions and 137 deletions
|
|
@ -11,11 +11,11 @@ generate_element!(
|
|||
ExplicitMessageEncryption, "encryption", EME,
|
||||
attributes: [
|
||||
/// Namespace of the encryption scheme used.
|
||||
namespace: String = "namespace" => required,
|
||||
namespace: Required<String> = "namespace",
|
||||
|
||||
/// User-friendly name for the encryption scheme, should be `None` for OTR,
|
||||
/// legacy OpenPGP and OX.
|
||||
name: Option<String> = "name" => optional,
|
||||
name: Option<String> = "name",
|
||||
]
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue