File tree Expand file tree Collapse file tree 3 files changed +10
-9
lines changed Expand file tree Collapse file tree 3 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,10 @@ impl FieldList {
157
157
self . fields . len ( ) as u16
158
158
}
159
159
160
+ pub fn is_empty ( & self ) -> bool {
161
+ self . len ( ) == 0
162
+ }
163
+
160
164
pub fn get ( self , index : u16 ) -> Field {
161
165
Field {
162
166
proto : self . fields . get ( index as u32 ) ,
@@ -337,13 +341,13 @@ impl EnumerantList {
337
341
}
338
342
}
339
343
340
- impl < ' a > IndexMove < u16 , Enumerant > for EnumerantList {
344
+ impl IndexMove < u16 , Enumerant > for EnumerantList {
341
345
fn index_move ( & self , index : u16 ) -> Enumerant {
342
346
self . get ( index)
343
347
}
344
348
}
345
349
346
- impl < ' a > :: core:: iter:: IntoIterator for EnumerantList {
350
+ impl :: core:: iter:: IntoIterator for EnumerantList {
347
351
type Item = Enumerant ;
348
352
type IntoIter = ShortListIter < Self , Self :: Item > ;
349
353
@@ -415,13 +419,13 @@ impl AnnotationList {
415
419
}
416
420
}
417
421
418
- impl < ' a > IndexMove < u32 , Annotation > for AnnotationList {
422
+ impl IndexMove < u32 , Annotation > for AnnotationList {
419
423
fn index_move ( & self , index : u32 ) -> Annotation {
420
424
self . get ( index)
421
425
}
422
426
}
423
427
424
- impl < ' a > :: core:: iter:: IntoIterator for AnnotationList {
428
+ impl :: core:: iter:: IntoIterator for AnnotationList {
425
429
type Item = Annotation ;
426
430
type IntoIter = ListIter < Self , Self :: Item > ;
427
431
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ impl<'b> NoAllocBufferSegments<&'b [u8]> {
115
115
/// ALIGNMENT: If the "unaligned" feature is enabled, then there are no alignment requirements on `buffer`.
116
116
/// Otherwise, `buffer` must be 8-byte aligned (attempts to read the message will trigger errors).
117
117
pub fn from_slice ( slice : & mut & ' b [ u8 ] , options : ReaderOptions ) -> Result < Self > {
118
- let segment_table_info = read_segment_table ( & * slice, options) ?;
118
+ let segment_table_info = read_segment_table ( slice, options) ?;
119
119
120
120
let message_length = segment_table_info. segment_table_length_bytes
121
121
+ segment_table_info. total_segments_length_bytes ;
Original file line number Diff line number Diff line change 68
68
T : crate :: traits:: OwnedStruct ,
69
69
{
70
70
fn clone ( & self ) -> Reader < ' a , T > {
71
- Reader {
72
- marker : self . marker ,
73
- reader : self . reader ,
74
- }
71
+ * self
75
72
}
76
73
}
77
74
impl < ' a , T > Copy for Reader < ' a , T > where T : crate :: traits:: OwnedStruct { }
You can’t perform that action at this time.
0 commit comments