Refactor env conversion to eliminate Value::follow_cell_path_not_from_user_input#10926
Refactor env conversion to eliminate Value::follow_cell_path_not_from_user_input#10926sholderbach merged 3 commits intonushell:mainfrom
Value::follow_cell_path_not_from_user_input#10926Conversation
| .and_then(|val| val.as_record().ok()) | ||
| .and_then(|record| record.get(name)) | ||
| .and_then(|val| val.as_record().ok()) | ||
| .and_then(|record| record.get(direction)); |
|
Hmm... I'm not sure why but I'm getting some jarbbled error output if the conversion is not a closure. And it only happens on the fourth time I press enter (I think once the text reaches the bottom of the terminal). Should we treat this as a separate issue? |
Can you reproduce something similar on To me it looks like it is outputting while the terminal is still in raw mode so the carriage return is not automatically added for I think worth filing a separate issue. |
# 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 (-)
|
Ok, opened a separate issue. That one was a doozy to figure out. |
|
Let's go with this! |
# Description This is pretty complementary/orthogonal to @IanManske 's changes to `Value` cellpath accessors in: - nushell#10925 - to a lesser extent nushell#10926 ## Steps - Use `R.remove` in `Value.remove_data_at_cell_path` - Pretty sound after nushell#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 (-)
…ll#10926) # Description Replaces the only usage of `Value::follow_cell_path_not_from_user_input` with some `Record::get`s. # User-Facing Changes Breaking change for `nu-protocol`, since `Value::follow_cell_path_not_from_user_input` was deleted. Nushell now reports errors for when environment conversions are not closures.
# Description This is pretty complementary/orthogonal to @IanManske 's changes to `Value` cellpath accessors in: - nushell#10925 - to a lesser extent nushell#10926 ## Steps - Use `R.remove` in `Value.remove_data_at_cell_path` - Pretty sound after nushell#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 (-)
…ll#10926) # Description Replaces the only usage of `Value::follow_cell_path_not_from_user_input` with some `Record::get`s. # User-Facing Changes Breaking change for `nu-protocol`, since `Value::follow_cell_path_not_from_user_input` was deleted. Nushell now reports errors for when environment conversions are not closures.
Description
Replaces the only usage of
Value::follow_cell_path_not_from_user_inputwith someRecord::gets.User-Facing Changes
Breaking change for
nu-protocol, sinceValue::follow_cell_path_not_from_user_inputwas deleted.Nushell now reports errors for when environment conversions are not closures.