mirror of
https://github.com/nushell/nushell.git
synced 2024-12-23 15:39:06 +01:00
remove expect so that config doesn't fail (#3510)
This commit is contained in:
parent
55baee9a9a
commit
87a6d7166c
@ -158,11 +158,13 @@ impl InlineShape {
|
||||
if let Some(fmt) = forced_format {
|
||||
filesize_format_var = fmt.to_ascii_lowercase();
|
||||
} else {
|
||||
filesize_format_var = crate::config::config(Tag::unknown())
|
||||
.expect("unable to get the config.toml file")
|
||||
.get("filesize_format")
|
||||
.map(|val| val.convert_to_string().to_ascii_lowercase())
|
||||
.unwrap_or_else(|| "auto".to_string());
|
||||
filesize_format_var = match crate::config::config(Tag::unknown()) {
|
||||
Ok(cfg) => cfg
|
||||
.get("filesize_format")
|
||||
.map(|val| val.convert_to_string().to_ascii_lowercase())
|
||||
.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
|
||||
|
Loading…
Reference in New Issue
Block a user