Skip to content

Commit

Permalink
chore: as_slice in Array
Browse files Browse the repository at this point in the history
  • Loading branch information
liuq19 committed Feb 8, 2025
1 parent 8fa4794 commit 1c63453
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/value/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,13 +414,13 @@ impl Array {
/// Extracts a mutable slice of the entire array. Equivalent to &mut s[..].
#[inline]
pub fn as_mut_slice(&mut self) -> &mut [Value] {
self
self.deref_mut()
}

/// Extracts a slice containing the entire array. Equivalent to &s[..].
#[inline]
pub fn as_slice(&self) -> &[Value] {
self
self.deref()
}

/// Returns the total number of elements the array can hold without reallocating.
Expand Down

0 comments on commit 1c63453

Please sign in to comment.