Skip to content

Commit d7e2e88

Browse files
committed
Load CSS as a file, not from raw data
1 parent 5a9ccd0 commit d7e2e88

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/main.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,9 @@ fn load_css_from_file(path: &dyn AsRef<Path>) -> Result<Option<CssProvider>, Str
132132
return Ok(None);
133133
}
134134

135-
let css_data =
136-
std::fs::read_to_string(path).map_err(|e| format!("Failed to read CSS file: {e}"))?;
137-
138135
let provider = CssProvider::new();
139136
provider
140-
.load_from_data(css_data.as_ref())
137+
.load_from_file(&gio::File::for_path(path))
141138
.map_err(|e| format!("Failed to load CSS: {e}"))?;
142139
Ok(Some(provider))
143140
}

0 commit comments

Comments
 (0)