Skip to content

Commit 1b4e714

Browse files
committed
fmt
1 parent 860d049 commit 1b4e714

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

src/console.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
// Helper functions for handling the Windows console from a GUI context.
32
//
43
// Windows subsystem applications must explicitly attach to an existing console
@@ -8,14 +7,12 @@
87
// These functions enable that, primarily for the purposes of displaying Rust
98
// panics.
109

11-
use winapi::um::consoleapi::{AllocConsole};
10+
use winapi::um::consoleapi::AllocConsole;
1211
use winapi::um::wincon::{AttachConsole, FreeConsole, GetConsoleWindow, ATTACH_PARENT_PROCESS};
1312

1413
/// Check if we're attached to an existing Windows console
1514
pub fn is_attached() -> bool {
16-
unsafe {
17-
!GetConsoleWindow().is_null()
18-
}
15+
unsafe { !GetConsoleWindow().is_null() }
1916
}
2017

2118
/// Try to attach to an existing Windows console, if necessary.

src/gui.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ use std::sync::Arc;
44

55
use crossbeam_channel::{bounded, Receiver};
66

7+
use crate::backend::Backend;
78
use dirs_sys::known_folder;
89
use serde_derive::{Deserialize, Serialize};
910
use web_view::*;
1011
use winapi::um::knownfolders;
11-
use crate::backend::Backend;
1212

1313
use crate::config::Config;
1414
use crate::folder::FolderSummary;

src/main.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
mod backend;
66
mod background;
7-
mod console;
87
mod compact;
98
mod compression;
109
mod config;
10+
mod console;
1111
mod folder;
1212
mod gui;
1313
mod persistence;
@@ -19,7 +19,8 @@ fn setup_panic() {
1919
return;
2020
}
2121

22-
println!(r#"
22+
println!(
23+
r#"
2324
Oh dear, {app} has crashed. Sorry :(
2425
2526
You can report this on the website at {website}/issues
@@ -30,13 +31,18 @@ you were doing - like what folder you were running it on.
3031
#############################################################################
3132
3233
App: {app}, Version: {ver}, Build Date: {date}, Hash: {hash}
33-
"#, app = env!("CARGO_PKG_NAME"), website = env!("CARGO_PKG_HOMEPAGE"),
34-
ver = env!("VERGEN_SEMVER"), date = env!("VERGEN_BUILD_DATE").to_string(), hash = env!("VERGEN_SHA_SHORT"));
34+
"#,
35+
app = env!("CARGO_PKG_NAME"),
36+
website = env!("CARGO_PKG_HOMEPAGE"),
37+
ver = env!("VERGEN_SEMVER"),
38+
date = env!("VERGEN_BUILD_DATE").to_string(),
39+
hash = env!("VERGEN_SHA_SHORT")
40+
);
3541

3642
if let Some(s) = e.payload().downcast_ref::<&'static str>() {
37-
println!("panic: {}", s);
43+
println!("panic: {}", s);
3844
} else {
39-
println!("panic: [mysteriously lacks a string representation]");
45+
println!("panic: [mysteriously lacks a string representation]");
4046
}
4147

4248
println!("\nHit Enter to print the rest of the debug info.");

0 commit comments

Comments
 (0)