Skip to content

Commit ab304e7

Browse files
committed
More code simplification
1 parent fbc2159 commit ab304e7

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/renderer/html_handlebars/static_files.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ impl StaticFiles {
229229
pub fn write_files(self, destination: &Path) -> Result<ResourceHelper> {
230230
use crate::utils::fs::write_file;
231231
use regex::bytes::{Captures, Regex};
232-
use std::io::Read;
233232
// The `{{ resource "name" }}` directive in static resources look like
234233
// handlebars syntax, even if they technically aren't.
235234
static RESOURCE: Lazy<Regex> =
@@ -278,9 +277,7 @@ impl StaticFiles {
278277
.with_context(|| format!("Unable to create {}", parent.display()))?;
279278
}
280279
if filename.ends_with(".css") || filename.ends_with(".js") {
281-
let mut file = File::open(input_location)?;
282-
let mut data = Vec::new();
283-
file.read_to_end(&mut data)?;
280+
let data = fs::read(input_location)?;
284281
let data = replace_all(&self.hash_map, &data, filename);
285282
write_file(destination, filename, &data)?;
286283
} else {

0 commit comments

Comments
 (0)