Skip to content

Commit 156f5d5

Browse files
committed
Make RawValue::is_* methods pub
1 parent 511c27b commit 156f5d5

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/raw.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ impl RawValue {
229229
}
230230

231231
/// Returns the kind of JSON value contained within.
232-
fn kind(&self) -> RawKind {
232+
pub fn kind(&self) -> RawKind {
233233
let first = self
234234
.json
235235
.as_bytes()
@@ -238,7 +238,7 @@ impl RawValue {
238238

239239
// `RawValue` has whitespace stripped so we know the first char is non-whitespace.
240240
// `RawValue` is also valid JSON so the only possible set of chars that can come next
241-
// are `[0-9]` or `[-fnt"[{]`.
241+
// are `[0-9]` or `[-pub fnt"[{]`.
242242
match *first {
243243
b'n' => RawKind::Null,
244244
b't' | b'f' => RawKind::Bool,
@@ -264,7 +264,7 @@ impl RawValue {
264264
/// // The boolean `false` is not null.
265265
/// assert!(!v["b"].is_null());
266266
/// ```
267-
fn is_null(&self) -> bool {
267+
pub fn is_null(&self) -> bool {
268268
matches!(self.kind(), RawKind::Null)
269269
}
270270

@@ -281,7 +281,7 @@ impl RawValue {
281281
/// // The string `"false"` is a string, not a boolean.
282282
/// assert!(!v["b"].is_boolean());
283283
/// ```
284-
fn is_boolean(&self) -> bool {
284+
pub fn is_boolean(&self) -> bool {
285285
matches!(self.kind(), RawKind::Bool)
286286
}
287287

@@ -298,7 +298,7 @@ impl RawValue {
298298
/// // The string `"2"` is a string, not a number.
299299
/// assert!(!v["b"].is_number());
300300
/// ```
301-
fn is_number(&self) -> bool {
301+
pub fn is_number(&self) -> bool {
302302
matches!(self.kind(), RawKind::Number)
303303
}
304304

@@ -315,7 +315,7 @@ impl RawValue {
315315
/// // The boolean `false` is not a string.
316316
/// assert!(!v["b"].is_string());
317317
/// ```
318-
fn is_string(&self) -> bool {
318+
pub fn is_string(&self) -> bool {
319319
matches!(self.kind(), RawKind::String)
320320
}
321321

@@ -332,7 +332,7 @@ impl RawValue {
332332
/// // an object, not an array
333333
/// assert!(!obj["b"].is_array());
334334
/// ```
335-
fn is_array(&self) -> bool {
335+
pub fn is_array(&self) -> bool {
336336
matches!(self.kind(), RawKind::Array)
337337
}
338338

@@ -350,7 +350,7 @@ impl RawValue {
350350
/// // array, not an object
351351
/// assert!(!obj["b"].is_object());
352352
/// ```
353-
fn is_object(&self) -> bool {
353+
pub fn is_object(&self) -> bool {
354354
matches!(self.kind(), RawKind::Object)
355355
}
356356
}

0 commit comments

Comments
 (0)