Skip to content

Commit a33c598

Browse files
committed
compiler: Fix compilation if SLINT_DEFAULT_STYLE.txt gets deleted
Fixes slint-ui#8445
1 parent 14483a6 commit a33c598

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

internal/compiler/typeloader.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,9 +1655,14 @@ fn get_native_style(all_loaded_files: &mut std::collections::BTreeSet<PathBuf>)
16551655
)
16561656
})
16571657
});
1658+
16581659
if let Some(style) = target_path.and_then(|target_path| {
1659-
all_loaded_files.insert(target_path.clone());
1660-
std::fs::read_to_string(target_path).map(|style| style.trim().into()).ok()
1660+
std::fs::read_to_string(&target_path)
1661+
.map(|style| {
1662+
all_loaded_files.insert(target_path);
1663+
style.trim().into()
1664+
})
1665+
.ok()
16611666
}) {
16621667
return style;
16631668
}

0 commit comments

Comments
 (0)