Fix comments and naming found in review in #355

This commit is contained in:
Olivier Goffart 2021-07-28 15:53:30 +02:00 committed by Olivier Goffart
parent 7821926002
commit 43e07320a5
3 changed files with 5 additions and 4 deletions

View file

@ -203,6 +203,7 @@ pub fn compile_with_config(
};
if std::env::var_os("SIXTYFPS_STYLE").is_none() && compiler_config.style.is_none() {
compiler_config.style = std::env::var_os("OUT_DIR").and_then(|path| {
// Same logic as in sixtyfps-rendering-backend-default's build script to get the path
let path = Path::new(&path).parent()?.parent()?.join("SIXTYFPS_DEFAULT_STYLE.txt");
let style = std::fs::read_to_string(path).ok()?;
Some(style.trim().into())