Skip to content

Commit bb8a2e9

Browse files
committed
Fix as_ref_array
1 parent 39d2b35 commit bb8a2e9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/value/with_array.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,15 @@ impl Value {
243243
matches!(self, Self::Array(_))
244244
}
245245

246-
pub fn as_ref_array(&self) -> Option<&Array> {
246+
pub fn as_array(&self) -> Option<&Array> {
247247
match self {
248-
Self::Array(v) if !v.is_null() => Some(v),
249-
Self::Array(_) => None,
250-
_ => panic!("not Value::Array"),
248+
Self::Array(v) => Some(v),
249+
_ => None,
251250
}
252251
}
252+
253+
#[deprecated(since = "1.0.0", note = "Use Value::as_array instead.")]
254+
pub fn as_ref_array(&self) -> Option<&Array> {
255+
self.as_array()
256+
}
253257
}

0 commit comments

Comments
 (0)