mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-18 13:55:23 -05:00
parent
5dca7a85e7
commit
58c9607edc
1 changed files with 10 additions and 1 deletions
|
@ -134,7 +134,11 @@ fn migrate_imports(
|
|||
recursion_limit: usize,
|
||||
) -> Result<(), String> {
|
||||
// Check if any imports need to be processed.
|
||||
let imports = match document["general"].get("import").and_then(|i| i.as_array()) {
|
||||
let imports = match document
|
||||
.get("general")
|
||||
.and_then(|general| general.get("import"))
|
||||
.and_then(|import| import.as_array())
|
||||
{
|
||||
Some(array) if !array.is_empty() => array,
|
||||
_ => return Ok(()),
|
||||
};
|
||||
|
@ -315,4 +319,9 @@ root_value = 3
|
|||
|
||||
assert_eq!(output, expected);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn migrate_empty() {
|
||||
assert!(migrate_toml(String::new()).unwrap().to_string().is_empty());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue