nushell/crates/nu-engine
Douglas fc29d82614
Only run from_string conversion on strings (#14509)
# Description

#14249 loaded `convert_env_values()` several times to force more updates
to `ENV_CONVERSION`. This allows the user to treat variables as
structured data inside `config.nu` (and others).

Unfortunately, `convert_env_values()` did not originally anticipate
being called more than once, so it would attempt to re-convert values
that had already been converted. This usually leads to an error in the
conversion closure.

With this PR, values are only converted with `from_string` if they are
still strings; otherwise they are skipped and their existing value is
used.

# User-Facing Changes

No user-facing change when compared to 0.100, since closures written for
0.100's `ENV_CONVERSION` now work again without errors.

# Tests + Formatting

- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`
- 
# After Submitting

Will remove the "workaround" from the Config doc preview.
2024-12-10 06:14:43 -06:00
..
src Only run from_string conversion on strings (#14509) 2024-12-10 06:14:43 -06:00
Cargo.toml Start to Add WASM Support Again (#14418) 2024-11-30 07:57:11 -06:00
LICENSE Fix rest of license year ranges (#8727) 2023-04-04 09:03:29 +12:00
README.md Add top-level crate documentation/READMEs (#12907) 2024-07-14 10:10:41 +02:00

This crate primarily drives the evaluation of expressions.

(Some overlap with nu-protocol)

  • Provides CallExt

Internal Nushell crate

This crate implements components of Nushell and is not designed to support plugin authors or other users directly.