File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -102,10 +102,15 @@ impl<'a> crate::traits::FromPointerReader<'a> for Reader<'a> {
102
102
}
103
103
104
104
impl < ' a > Reader < ' a > {
105
+ /// The string's length, in bytes.
105
106
pub fn len ( & self ) -> usize {
106
107
self . as_bytes ( ) . len ( )
107
108
}
108
109
110
+ pub fn is_empty ( & self ) -> bool {
111
+ self . len ( ) == 0
112
+ }
113
+
109
114
pub fn as_bytes ( self ) -> & ' a [ u8 ] {
110
115
let Self ( d) = self ;
111
116
d
@@ -159,10 +164,15 @@ impl<'a> Builder<'a> {
159
164
Builder { bytes, pos }
160
165
}
161
166
167
+ /// The string's length, in bytes.
162
168
pub fn len ( & self ) -> usize {
163
169
self . bytes . len ( )
164
170
}
165
171
172
+ pub fn is_empty ( & self ) -> bool {
173
+ self . len ( ) == 0
174
+ }
175
+
166
176
pub fn as_bytes ( self ) -> & ' a [ u8 ] {
167
177
& self . bytes [ ..]
168
178
}
You can’t perform that action at this time.
0 commit comments