mirror of
https://github.com/nushell/nushell.git
synced 2025-08-16 15:42:33 +02:00
Use slices directly instead of &Vec
(#10328)
Simplifies the signature, makes it more flexible. Detected a few unnecessary allocations in the process.
This commit is contained in:
committed by
GitHub
parent
84c10de864
commit
e90b099622
@ -182,7 +182,7 @@ impl Value {
|
||||
|
||||
/// If the `Value` is an Array, returns the associated vector.
|
||||
/// Returns None otherwise.
|
||||
pub fn as_array(&self) -> Option<&Vec<Value>> {
|
||||
pub fn as_array(&self) -> Option<&[Value]> {
|
||||
match self {
|
||||
Value::Array(array) => Some(array),
|
||||
_ => None,
|
||||
|
Reference in New Issue
Block a user