Skip to content

Commit f3ce0d8

Browse files
author
Jason Mobarak
committed
fmt
1 parent b7556e2 commit f3ce0d8

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

entrypoint/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn main() -> Result<()> {
1414
.set_icon("../resources/images/icon.ico")
1515
.compile()?;
1616

17-
println!("cargo:rerun-if-changed=../resources/images/splash.jpg");
17+
println!("cargo:rerun-if-changed=../resources/images/splash.jpg");
1818
}
1919
Ok(())
2020
}

entrypoint/src/splash.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ type Result<T> = std::result::Result<T, Error>;
2121
lazy_static! {
2222
static ref PID_FILE: PathBuf = {
2323
let pid = std::process::id();
24-
std::env::temp_dir().join(format!("{TEMP_FILENAME}.{pid}")).into()
24+
std::env::temp_dir()
25+
.join(format!("{TEMP_FILENAME}.{pid}"))
26+
.into()
2527
};
2628
}
2729

@@ -49,14 +51,10 @@ fn launch_splash() -> Result<()> {
4951
.collect();
5052
let current_monitor = WinitWindow::new(&EventLoop::new())?
5153
.current_monitor()
52-
.ok_or_else(||{
53-
Into::<Error>::into(String::from("could not get current monitor"))
54-
})?;
54+
.ok_or_else(|| Into::<Error>::into(String::from("could not get current monitor")))?;
5555
let size = current_monitor.size();
56-
let pos_x = ((size.width as f64 - image.width() as f64) / 2.0)
57-
as isize;
58-
let pos_y = ((size.height as f64 - image.height() as f64)
59-
/ 2.0) as isize;
56+
let pos_x = ((size.width as f64 - image.width() as f64) / 2.0) as isize;
57+
let pos_y = ((size.height as f64 - image.height() as f64) / 2.0) as isize;
6058

6159
let mut window = Window::new(
6260
"",
@@ -74,8 +72,7 @@ fn launch_splash() -> Result<()> {
7472
let temp_filename = create_temp_file()?;
7573
let now = Instant::now();
7674
while window.is_open() && now.elapsed() < TIMEOUT_DURATION && temp_filename.exists() {
77-
window
78-
.update_with_buffer(&u32_buffer, image.width() as usize, image.height() as usize)?;
75+
window.update_with_buffer(&u32_buffer, image.width() as usize, image.height() as usize)?;
7976
window.set_position(pos_x, pos_y);
8077
}
8178

0 commit comments

Comments
 (0)