@@ -5,7 +5,7 @@ use const_oid::db::rfc4519::{COUNTRY_NAME, DOMAIN_COMPONENT};
5
5
use core:: fmt:: { self , Write } ;
6
6
7
7
use const_oid:: db:: DB ;
8
- use der:: asn1:: { AnyRef , ObjectIdentifier , SetOfVec } ;
8
+ use der:: asn1:: { Any , ObjectIdentifier , SetOfVec } ;
9
9
use der:: { Decode , Encode , Error , ErrorKind , Sequence , Tag , Tagged , ValueOrd } ;
10
10
11
11
/// X.501 `AttributeType` as defined in [RFC 5280 Appendix A.1].
@@ -24,7 +24,7 @@ pub type AttributeType = ObjectIdentifier;
24
24
/// ```
25
25
///
26
26
/// [RFC 5280 Appendix A.1]: https://datatracker.ietf.org/doc/html/rfc5280#appendix-A.1
27
- pub type AttributeValue < ' a > = AnyRef < ' a > ;
27
+ pub type AttributeValue = Any ;
28
28
29
29
/// X.501 `Attribute` as defined in [RFC 5280 Appendix A.1].
30
30
///
@@ -50,15 +50,15 @@ pub type AttributeValue<'a> = AnyRef<'a>;
50
50
/// [RFC 5280 Appendix A.1]: https://datatracker.ietf.org/doc/html/rfc5280#appendix-A.1
51
51
#[ derive( Clone , Debug , PartialEq , Eq , Sequence , ValueOrd ) ]
52
52
#[ allow( missing_docs) ]
53
- pub struct Attribute < ' a > {
53
+ pub struct Attribute {
54
54
pub oid : AttributeType ,
55
- pub values : SetOfVec < AttributeValue < ' a > > ,
55
+ pub values : SetOfVec < AttributeValue > ,
56
56
}
57
57
58
- impl < ' a > TryFrom < & ' a [ u8 ] > for Attribute < ' a > {
58
+ impl TryFrom < & [ u8 ] > for Attribute {
59
59
type Error = Error ;
60
60
61
- fn try_from ( bytes : & ' a [ u8 ] ) -> Result < Self , Self :: Error > {
61
+ fn try_from ( bytes : & [ u8 ] ) -> Result < Self , Self :: Error > {
62
62
Self :: from_der ( bytes)
63
63
}
64
64
}
@@ -70,7 +70,7 @@ impl<'a> TryFrom<&'a [u8]> for Attribute<'a> {
70
70
/// ```
71
71
///
72
72
/// [RFC 2986 Section 4]: https://datatracker.ietf.org/doc/html/rfc2986#section-4
73
- pub type Attributes < ' a > = SetOfVec < Attribute < ' a > > ;
73
+ pub type Attributes = SetOfVec < Attribute > ;
74
74
75
75
/// X.501 `AttributeTypeAndValue` as defined in [RFC 5280 Appendix A.1].
76
76
///
@@ -82,11 +82,11 @@ pub type Attributes<'a> = SetOfVec<Attribute<'a>>;
82
82
/// ```
83
83
///
84
84
/// [RFC 5280 Appendix A.1]: https://datatracker.ietf.org/doc/html/rfc5280#appendix-A.1
85
- #[ derive( Copy , Clone , Debug , Eq , PartialEq , PartialOrd , Ord , Sequence , ValueOrd ) ]
85
+ #[ derive( Clone , Debug , Eq , PartialEq , PartialOrd , Ord , Sequence , ValueOrd ) ]
86
86
#[ allow( missing_docs) ]
87
- pub struct AttributeTypeAndValue < ' a > {
87
+ pub struct AttributeTypeAndValue {
88
88
pub oid : AttributeType ,
89
- pub value : AnyRef < ' a > ,
89
+ pub value : AttributeValue ,
90
90
}
91
91
92
92
#[ derive( Copy , Clone ) ]
@@ -141,7 +141,7 @@ impl Parser {
141
141
}
142
142
}
143
143
144
- impl AttributeTypeAndValue < ' _ > {
144
+ impl AttributeTypeAndValue {
145
145
/// Parses the hex value in the `OID=#HEX` format.
146
146
fn encode_hex ( oid : ObjectIdentifier , val : & str ) -> Result < Vec < u8 > , Error > {
147
147
// Ensure an even number of hex bytes.
@@ -169,7 +169,7 @@ impl AttributeTypeAndValue<'_> {
169
169
}
170
170
171
171
// Serialize.
172
- let value = AnyRef :: from_der ( & bytes) ?;
172
+ let value = Any :: from_der ( & bytes) ?;
173
173
let atv = AttributeTypeAndValue { oid, value } ;
174
174
atv. to_vec ( )
175
175
}
@@ -189,7 +189,7 @@ impl AttributeTypeAndValue<'_> {
189
189
} ;
190
190
191
191
// Serialize.
192
- let value = AnyRef :: new ( tag, parser. as_bytes ( ) ) ?;
192
+ let value = Any :: new ( tag, parser. as_bytes ( ) ) ?;
193
193
let atv = AttributeTypeAndValue { oid, value } ;
194
194
atv. to_vec ( )
195
195
}
@@ -221,7 +221,7 @@ impl AttributeTypeAndValue<'_> {
221
221
/// Serializes the structure according to the rules in [RFC 4514].
222
222
///
223
223
/// [RFC 4514]: https://datatracker.ietf.org/doc/html/rfc4514
224
- impl fmt:: Display for AttributeTypeAndValue < ' _ > {
224
+ impl fmt:: Display for AttributeTypeAndValue {
225
225
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
226
226
let val = match self . value . tag ( ) {
227
227
Tag :: PrintableString => self . value . printable_string ( ) . ok ( ) . map ( |s| s. as_str ( ) ) ,
0 commit comments