Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
windows: Remove unnecessary code in #25412 (#25805)
张小白22220ed32e1e
diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rsindex a66f298f392..ce898b33a03 100644--- a/crates/zed/src/main.rs+++ b/crates/zed/src/main.rs@@ -171,17 +171,12 @@ fn fail_to_open_window(e: anyhow::Error, _cx: &mut App) {fn main() {let args = Args::parse();- #[cfg(target_os = "windows")]- let run_foreground = args.foreground;-#[cfg(all(not(debug_assertions), target_os = "windows"))]- if run_foreground {- unsafe {- use windows::Win32::System::Console::{AttachConsole, ATTACH_PARENT_PROCESS};+ unsafe {+ use windows::Win32::System::Console::{AttachConsole, ATTACH_PARENT_PROCESS};- if run_foreground {- let _ = AttachConsole(ATTACH_PARENT_PROCESS);- }+ if args.foreground {+ let _ = AttachConsole(ATTACH_PARENT_PROCESS);}}@@ -235,7 +230,7 @@ fn main() {{!crate::zed::windows_only_instance::check_single_instance(open_listener.clone(),- run_foreground,+ args.foreground,)}