mirror of
https://github.com/nushell/nushell
synced 2024-12-28 22:13:10 +00:00
remove expect so that config doesn't fail (#3510)
This commit is contained in:
parent
55baee9a9a
commit
87a6d7166c
1 changed files with 7 additions and 5 deletions
|
@ -158,11 +158,13 @@ impl InlineShape {
|
||||||
if let Some(fmt) = forced_format {
|
if let Some(fmt) = forced_format {
|
||||||
filesize_format_var = fmt.to_ascii_lowercase();
|
filesize_format_var = fmt.to_ascii_lowercase();
|
||||||
} else {
|
} else {
|
||||||
filesize_format_var = crate::config::config(Tag::unknown())
|
filesize_format_var = match crate::config::config(Tag::unknown()) {
|
||||||
.expect("unable to get the config.toml file")
|
Ok(cfg) => cfg
|
||||||
.get("filesize_format")
|
.get("filesize_format")
|
||||||
.map(|val| val.convert_to_string().to_ascii_lowercase())
|
.map(|val| val.convert_to_string().to_ascii_lowercase())
|
||||||
.unwrap_or_else(|| "auto".to_string());
|
.unwrap_or_else(|| "auto".to_string()),
|
||||||
|
_ => "auto".to_string(),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if there is a value, match it to one of the valid values for byte units
|
// if there is a value, match it to one of the valid values for byte units
|
||||||
|
|
Loading…
Reference in a new issue