File tree 13 files changed +45
-45
lines changed
13 files changed +45
-45
lines changed Original file line number Diff line number Diff line change @@ -277,7 +277,7 @@ mod allocating {
277
277
278
278
impl < ' a > RefToOwned < ' a > for AnyRef < ' a > {
279
279
type Owned = Any ;
280
- fn to_owned ( & self ) -> Self :: Owned {
280
+ fn ref_to_owned ( & self ) -> Self :: Owned {
281
281
Any {
282
282
tag : self . tag ( ) ,
283
283
value : BytesOwned :: from ( self . value ) ,
@@ -287,15 +287,15 @@ mod allocating {
287
287
288
288
impl OwnedToRef for Any {
289
289
type Borrowed < ' a > = AnyRef < ' a > ;
290
- fn to_ref ( & self ) -> Self :: Borrowed < ' _ > {
290
+ fn owned_to_ref ( & self ) -> Self :: Borrowed < ' _ > {
291
291
self . into ( )
292
292
}
293
293
}
294
294
295
295
impl Any {
296
296
/// Is this value an ASN.1 `NULL` value?
297
297
pub fn is_null ( & self ) -> bool {
298
- self . to_ref ( ) == AnyRef :: NULL
298
+ self . owned_to_ref ( ) == AnyRef :: NULL
299
299
}
300
300
}
301
301
}
Original file line number Diff line number Diff line change @@ -379,7 +379,7 @@ mod allocating {
379
379
380
380
impl < ' a > RefToOwned < ' a > for BitStringRef < ' a > {
381
381
type Owned = BitString ;
382
- fn to_owned ( & self ) -> Self :: Owned {
382
+ fn ref_to_owned ( & self ) -> Self :: Owned {
383
383
BitString {
384
384
unused_bits : self . unused_bits ,
385
385
bit_length : self . bit_length ,
@@ -390,7 +390,7 @@ mod allocating {
390
390
391
391
impl OwnedToRef for BitString {
392
392
type Borrowed < ' a > = BitStringRef < ' a > ;
393
- fn to_ref ( & self ) -> Self :: Borrowed < ' _ > {
393
+ fn owned_to_ref ( & self ) -> Self :: Borrowed < ' _ > {
394
394
self . into ( )
395
395
}
396
396
}
Original file line number Diff line number Diff line change @@ -150,18 +150,18 @@ mod allocation {
150
150
151
151
impl < ' a > RefToOwned < ' a > for Ia5StringRef < ' a > {
152
152
type Owned = Ia5String ;
153
- fn to_owned ( & self ) -> Self :: Owned {
153
+ fn ref_to_owned ( & self ) -> Self :: Owned {
154
154
Ia5String {
155
- inner : self . inner . to_owned ( ) ,
155
+ inner : self . inner . ref_to_owned ( ) ,
156
156
}
157
157
}
158
158
}
159
159
160
160
impl OwnedToRef for Ia5String {
161
161
type Borrowed < ' a > = Ia5StringRef < ' a > ;
162
- fn to_ref ( & self ) -> Self :: Borrowed < ' _ > {
162
+ fn owned_to_ref ( & self ) -> Self :: Borrowed < ' _ > {
163
163
Ia5StringRef {
164
- inner : self . inner . to_ref ( ) ,
164
+ inner : self . inner . owned_to_ref ( ) ,
165
165
}
166
166
}
167
167
}
Original file line number Diff line number Diff line change @@ -277,17 +277,17 @@ mod allocating {
277
277
278
278
impl < ' a > RefToOwned < ' a > for IntRef < ' a > {
279
279
type Owned = Int ;
280
- fn to_owned ( & self ) -> Self :: Owned {
281
- let inner = self . inner . to_owned ( ) ;
280
+ fn ref_to_owned ( & self ) -> Self :: Owned {
281
+ let inner = self . inner . ref_to_owned ( ) ;
282
282
283
283
Int { inner }
284
284
}
285
285
}
286
286
287
287
impl OwnedToRef for Int {
288
288
type Borrowed < ' a > = IntRef < ' a > ;
289
- fn to_ref ( & self ) -> Self :: Borrowed < ' _ > {
290
- let inner = self . inner . to_ref ( ) ;
289
+ fn owned_to_ref ( & self ) -> Self :: Borrowed < ' _ > {
290
+ let inner = self . inner . owned_to_ref ( ) ;
291
291
292
292
IntRef { inner }
293
293
}
@@ -384,17 +384,17 @@ mod allocating {
384
384
385
385
impl < ' a > RefToOwned < ' a > for UintRef < ' a > {
386
386
type Owned = Uint ;
387
- fn to_owned ( & self ) -> Self :: Owned {
388
- let inner = self . inner . to_owned ( ) ;
387
+ fn ref_to_owned ( & self ) -> Self :: Owned {
388
+ let inner = self . inner . ref_to_owned ( ) ;
389
389
390
390
Uint { inner }
391
391
}
392
392
}
393
393
394
394
impl OwnedToRef for Uint {
395
395
type Borrowed < ' a > = UintRef < ' a > ;
396
- fn to_ref ( & self ) -> Self :: Borrowed < ' _ > {
397
- let inner = self . inner . to_ref ( ) ;
396
+ fn owned_to_ref ( & self ) -> Self :: Borrowed < ' _ > {
397
+ let inner = self . inner . owned_to_ref ( ) ;
398
398
399
399
UintRef { inner }
400
400
}
Original file line number Diff line number Diff line change @@ -221,18 +221,18 @@ mod allocation {
221
221
222
222
impl < ' a > RefToOwned < ' a > for PrintableStringRef < ' a > {
223
223
type Owned = PrintableString ;
224
- fn to_owned ( & self ) -> Self :: Owned {
224
+ fn ref_to_owned ( & self ) -> Self :: Owned {
225
225
PrintableString {
226
- inner : self . inner . to_owned ( ) ,
226
+ inner : self . inner . ref_to_owned ( ) ,
227
227
}
228
228
}
229
229
}
230
230
231
231
impl OwnedToRef for PrintableString {
232
232
type Borrowed < ' a > = PrintableStringRef < ' a > ;
233
- fn to_ref ( & self ) -> Self :: Borrowed < ' _ > {
233
+ fn owned_to_ref ( & self ) -> Self :: Borrowed < ' _ > {
234
234
PrintableStringRef {
235
- inner : self . inner . to_ref ( ) ,
235
+ inner : self . inner . owned_to_ref ( ) ,
236
236
}
237
237
}
238
238
}
Original file line number Diff line number Diff line change @@ -179,18 +179,18 @@ mod allocation {
179
179
180
180
impl < ' a > RefToOwned < ' a > for TeletexStringRef < ' a > {
181
181
type Owned = TeletexString ;
182
- fn to_owned ( & self ) -> Self :: Owned {
182
+ fn ref_to_owned ( & self ) -> Self :: Owned {
183
183
TeletexString {
184
- inner : self . inner . to_owned ( ) ,
184
+ inner : self . inner . ref_to_owned ( ) ,
185
185
}
186
186
}
187
187
}
188
188
189
189
impl OwnedToRef for TeletexString {
190
190
type Borrowed < ' a > = TeletexStringRef < ' a > ;
191
- fn to_ref ( & self ) -> Self :: Borrowed < ' _ > {
191
+ fn owned_to_ref ( & self ) -> Self :: Borrowed < ' _ > {
192
192
TeletexStringRef {
193
- inner : self . inner . to_ref ( ) ,
193
+ inner : self . inner . owned_to_ref ( ) ,
194
194
}
195
195
}
196
196
}
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ impl From<StrRef<'_>> for BytesOwned {
97
97
98
98
impl OwnedToRef for BytesOwned {
99
99
type Borrowed < ' a > = BytesRef < ' a > ;
100
- fn to_ref ( & self ) -> Self :: Borrowed < ' _ > {
100
+ fn owned_to_ref ( & self ) -> Self :: Borrowed < ' _ > {
101
101
BytesRef {
102
102
length : self . length ,
103
103
inner : self . inner . as_ref ( ) ,
Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ mod allocating {
145
145
146
146
impl < ' a > RefToOwned < ' a > for BytesRef < ' a > {
147
147
type Owned = BytesOwned ;
148
- fn to_owned ( & self ) -> Self :: Owned {
148
+ fn ref_to_owned ( & self ) -> Self :: Owned {
149
149
BytesOwned :: from ( * self )
150
150
}
151
151
}
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ pub trait OwnedToRef {
8
8
Self : ' a ;
9
9
10
10
/// Creates a new object referencing back to the self for storage
11
- fn to_ref ( & self ) -> Self :: Borrowed < ' _ > ;
11
+ fn owned_to_ref ( & self ) -> Self :: Borrowed < ' _ > ;
12
12
}
13
13
14
14
/// A trait for cloning a referenced structure and getting owned objects
@@ -21,7 +21,7 @@ pub trait RefToOwned<'a> {
21
21
Self : ' a ;
22
22
23
23
/// Creates a new object taking ownership of the data
24
- fn to_owned ( & self ) -> Self :: Owned ;
24
+ fn ref_to_owned ( & self ) -> Self :: Owned ;
25
25
}
26
26
27
27
impl < T > OwnedToRef for Option < T >
30
30
{
31
31
type Borrowed < ' a > = Option < T :: Borrowed < ' a > > where T : ' a ;
32
32
33
- fn to_ref ( & self ) -> Self :: Borrowed < ' _ > {
34
- self . as_ref ( ) . map ( |o| o. to_ref ( ) )
33
+ fn owned_to_ref ( & self ) -> Self :: Borrowed < ' _ > {
34
+ self . as_ref ( ) . map ( |o| o. owned_to_ref ( ) )
35
35
}
36
36
}
37
37
41
41
T :: Owned : OwnedToRef ,
42
42
{
43
43
type Owned = Option < T :: Owned > ;
44
- fn to_owned ( & self ) -> Self :: Owned {
45
- self . as_ref ( ) . map ( |o| o. to_owned ( ) )
44
+ fn ref_to_owned ( & self ) -> Self :: Owned {
45
+ self . as_ref ( ) . map ( |o| o. ref_to_owned ( ) )
46
46
}
47
47
}
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ impl From<StrRef<'_>> for StrOwned {
96
96
97
97
impl OwnedToRef for StrOwned {
98
98
type Borrowed < ' a > = StrRef < ' a > ;
99
- fn to_ref ( & self ) -> Self :: Borrowed < ' _ > {
99
+ fn owned_to_ref ( & self ) -> Self :: Borrowed < ' _ > {
100
100
StrRef {
101
101
length : self . length ,
102
102
inner : self . inner . as_ref ( ) ,
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ mod allocating {
85
85
86
86
impl < ' a > RefToOwned < ' a > for StrRef < ' a > {
87
87
type Owned = StrOwned ;
88
- fn to_owned ( & self ) -> Self :: Owned {
88
+ fn ref_to_owned ( & self ) -> Self :: Owned {
89
89
StrOwned :: from ( * self )
90
90
}
91
91
}
Original file line number Diff line number Diff line change @@ -171,20 +171,20 @@ mod allocating {
171
171
172
172
impl < ' a > RefToOwned < ' a > for AlgorithmIdentifierRef < ' a > {
173
173
type Owned = AlgorithmIdentifierOwned ;
174
- fn to_owned ( & self ) -> Self :: Owned {
174
+ fn ref_to_owned ( & self ) -> Self :: Owned {
175
175
AlgorithmIdentifier {
176
176
oid : self . oid ,
177
- parameters : self . parameters . to_owned ( ) ,
177
+ parameters : self . parameters . ref_to_owned ( ) ,
178
178
}
179
179
}
180
180
}
181
181
182
182
impl OwnedToRef for AlgorithmIdentifierOwned {
183
183
type Borrowed < ' a > = AlgorithmIdentifierRef < ' a > ;
184
- fn to_ref ( & self ) -> Self :: Borrowed < ' _ > {
184
+ fn owned_to_ref ( & self ) -> Self :: Borrowed < ' _ > {
185
185
AlgorithmIdentifier {
186
186
oid : self . oid ,
187
- parameters : self . parameters . to_ref ( ) ,
187
+ parameters : self . parameters . owned_to_ref ( ) ,
188
188
}
189
189
}
190
190
}
Original file line number Diff line number Diff line change @@ -193,20 +193,20 @@ mod allocating {
193
193
194
194
impl < ' a > RefToOwned < ' a > for SubjectPublicKeyInfoRef < ' a > {
195
195
type Owned = SubjectPublicKeyInfoOwned ;
196
- fn to_owned ( & self ) -> Self :: Owned {
196
+ fn ref_to_owned ( & self ) -> Self :: Owned {
197
197
SubjectPublicKeyInfo {
198
- algorithm : self . algorithm . to_owned ( ) ,
199
- subject_public_key : self . subject_public_key . to_owned ( ) ,
198
+ algorithm : self . algorithm . ref_to_owned ( ) ,
199
+ subject_public_key : self . subject_public_key . ref_to_owned ( ) ,
200
200
}
201
201
}
202
202
}
203
203
204
204
impl OwnedToRef for SubjectPublicKeyInfoOwned {
205
205
type Borrowed < ' a > = SubjectPublicKeyInfoRef < ' a > ;
206
- fn to_ref ( & self ) -> Self :: Borrowed < ' _ > {
206
+ fn owned_to_ref ( & self ) -> Self :: Borrowed < ' _ > {
207
207
SubjectPublicKeyInfo {
208
- algorithm : self . algorithm . to_ref ( ) ,
209
- subject_public_key : self . subject_public_key . to_ref ( ) ,
208
+ algorithm : self . algorithm . owned_to_ref ( ) ,
209
+ subject_public_key : self . subject_public_key . owned_to_ref ( ) ,
210
210
}
211
211
}
212
212
}
You can’t perform that action at this time.
0 commit comments