mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 00:18:28 +02:00
ensure get
doesn't delve too deep in nested lists (#7497)
# Description Fixes #7494. ``` /home/gabriel/CodingProjects/nushell〉[[{foo: bar}]] | get foo 12/16/2022 12:31:17 PM Error: nu::parser::not_found (link) × Not found. ╭─[entry #1:1:1] 1 │ [[{foo: bar}]] | get foo · ───────┬────── · ╰── did not find anything under this name ╰──── ``` # User-Facing Changes cell paths no longer drill into nested tables. # Tests + Formatting Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass # After Submitting If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date.
This commit is contained in:
@ -717,6 +717,7 @@ impl Value {
|
||||
let mut output = vec![];
|
||||
let mut hasvalue = false;
|
||||
let mut temp: Result<Value, ShellError> = Err(ShellError::NotFound(*span));
|
||||
let vals = vals.iter().filter(|v| matches!(v, Value::Record { .. }));
|
||||
for val in vals {
|
||||
temp = val.clone().follow_cell_path(
|
||||
&[PathMember::String {
|
||||
|
Reference in New Issue
Block a user