Use record API in more parts of nu-protocol (#10928)

# Description

This is pretty complementary/orthogonal to @IanManske 's changes to
`Value` cellpath accessors in:
- #10925
- to a lesser extent #10926

## Steps
- Use `R.remove` in `Value.remove_data_at_cell_path`
- Pretty sound after #10875 (tests mentioned in commit message have been
removed by that)
- Update `did_you_mean` helper to use iterator
- Change `Value::columns` to return iterator
  - This is not a place of honor
- Use `Record::get` in `Value::get_data_by_key`
# User-Facing Changes
None intentional, potential edge cases on duplicated columns could
change (considered undefined behavior)

# Tests + Formatting
(-)
This commit is contained in:
Stefan Holderbach
2023-11-08 23:03:08 +01:00
committed by GitHub
parent 44c0db46e1
commit 92503e6571
6 changed files with 22 additions and 38 deletions

View File

@ -99,7 +99,7 @@ impl Iterator for UpdateCellIterator {
match self.input.next() {
Some(val) => {
if let Some(ref cols) = self.columns {
if !val.columns().iter().any(|c| cols.contains(c)) {
if !val.columns().any(|c| cols.contains(c)) {
return Some(val);
}
}