mirror of
https://github.com/nushell/nushell.git
synced 2025-08-17 02:11:21 +02:00
Use IntoValue
in config code (#13751)
# Description Cleans up and refactors the config code using the `IntoValue` macro. Shoutout to @cptpiepmatz for making the macro! # User-Facing Changes Should be none. # After Submitting Somehow refactor the reverse transformation.
This commit is contained in:
@ -177,8 +177,8 @@ impl ExploreConfig {
|
||||
pub fn from_nu_config(config: &Config) -> Self {
|
||||
let mut ret = Self::default();
|
||||
|
||||
ret.table.column_padding_left = config.table_indent.left;
|
||||
ret.table.column_padding_right = config.table_indent.right;
|
||||
ret.table.column_padding_left = config.table.padding.left;
|
||||
ret.table.column_padding_right = config.table.padding.right;
|
||||
|
||||
let explore_cfg_hash_map = config.explore.clone();
|
||||
let colors = get_color_map(&explore_cfg_hash_map);
|
||||
|
@ -36,8 +36,8 @@ fn try_build_map(
|
||||
signals,
|
||||
Span::unknown(),
|
||||
usize::MAX,
|
||||
(config.table_indent.left, config.table_indent.right),
|
||||
config.table_mode,
|
||||
(config.table.padding.left, config.table.padding.right),
|
||||
config.table.mode,
|
||||
0,
|
||||
false,
|
||||
);
|
||||
@ -63,8 +63,8 @@ fn try_build_list(
|
||||
signals,
|
||||
Span::unknown(),
|
||||
usize::MAX,
|
||||
(config.table_indent.left, config.table_indent.right),
|
||||
config.table_mode,
|
||||
(config.table.padding.left, config.table.padding.right),
|
||||
config.table.mode,
|
||||
0,
|
||||
false,
|
||||
);
|
||||
|
Reference in New Issue
Block a user