nushell/crates/nu-command/src/formats/to
Devyn Cairns f65bc97a54
Update config directly at assignment (#13332)
# Description

Allows `Stack` to have a modified local `Config`, which is updated
immediately when `$env.config` is assigned to. This means that even
within a script, commands that come after `$env.config` changes will
always see those changes in `Stack::get_config()`.

Also fixed a lot of cases where `engine_state.get_config()` was used
even when `Stack` was available.

Closes #13324.

# User-Facing Changes
- Config changes apply immediately after the assignment is executed,
rather than whenever config is read by a command that needs it.
- Potentially slower performance when executing a lot of lines that
change `$env.config` one after another. Recommended to get `$env.config`
into a `mut` variable first and do modifications, then assign it back.
- Much faster performance when executing a script that made
modifications to `$env.config`, as the changes are only parsed once.

# Tests + Formatting
All passing.

# After Submitting
- [ ] release notes
2024-07-11 06:09:33 -07:00
..
command.rs Make get_full_help take &dyn Command (#12903) 2024-05-19 19:56:33 +02:00
csv.rs Implement streaming I/O for CSV and TSV commands (#12918) 2024-05-22 16:55:24 +00:00
delimited.rs Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
json.rs Use pipeline data for http post|put|patch|delete commands. (#13254) 2024-07-01 12:34:19 -07:00
md.rs Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
mod.rs Msgpack commands (#12664) 2024-04-26 06:23:16 -05:00
msgpack.rs Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
msgpackz.rs msgpackz: increase default compression level (#13035) 2024-06-04 17:19:10 -07:00
nuon.rs Replace ExternalStream with new ByteStream type (#12774) 2024-05-16 07:11:18 -07:00
text.rs Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
toml.rs Use native toml datetime type in to toml (#13018) 2024-06-07 07:43:30 -05:00
tsv.rs Implement streaming I/O for CSV and TSV commands (#12918) 2024-05-22 16:55:24 +00:00
xml.rs Replace ExternalStream with new ByteStream type (#12774) 2024-05-16 07:11:18 -07:00
yaml.rs Replace ExternalStream with new ByteStream type (#12774) 2024-05-16 07:11:18 -07:00