Skip to content

Commit

Permalink
bufreader
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianLars committed Aug 5, 2024
1 parent 38af0bb commit e7548a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tooling/bundler/src/bundle/linux/freedesktop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use std::collections::BTreeMap;
use std::ffi::OsStr;
use std::fs::{read_to_string, File};
use std::io::BufReader;
use std::path::{Path, PathBuf};

use anyhow::Context;
Expand Down Expand Up @@ -60,7 +61,7 @@ pub fn list_icon_files(
}
// Put file in scope so that it's closed when copying it
let icon = {
let decoder = PngDecoder::new(File::open(&icon_path)?)?;
let decoder = PngDecoder::new(BufReader::new(File::open(&icon_path)?))?;
let width = decoder.dimensions().0;
let height = decoder.dimensions().1;
let is_high_density = common::is_retina(&icon_path);
Expand Down
4 changes: 2 additions & 2 deletions tooling/bundler/src/bundle/macos/ios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use std::{
collections::BTreeSet,
ffi::OsStr,
fs::{self, File},
io::Write,
io::{BufReader, Write},
path::{Path, PathBuf},
};

Expand Down Expand Up @@ -91,7 +91,7 @@ fn generate_icon_files(bundle_dir: &Path, settings: &Settings) -> crate::Result<
if icon_path.extension() != Some(OsStr::new("png")) {
continue;
}
let decoder = PngDecoder::new(File::open(&icon_path)?)?;
let decoder = PngDecoder::new(BufReader::new(File::open(&icon_path)?))?;
let width = decoder.dimensions().0;
let height = decoder.dimensions().1;
let is_retina = common::is_retina(&icon_path);
Expand Down

0 comments on commit e7548a6

Please sign in to comment.