Skip to content

Commit 588b488

Browse files
committed
fix: wrap non-macos path in #[cfg(not(target_os = "macos"))]
1 parent 6e7623c commit 588b488

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

server/src/server.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,12 @@ impl PlayerStats {
8787

8888
fn main() -> Result<()> {
8989
#[cfg(target_os = "macos")]
90-
return termusicplayback::macos::run_with_run_loop(|| {
91-
let rt = tokio::runtime::Runtime::new()?;
92-
rt.block_on(actual_main())
93-
});
90+
return termusicplayback::macos::run_with_run_loop(actual_main);
9491

9592
#[cfg(not(target_os = "macos"))]
9693
{
97-
let rt = tokio::runtime::Runtime::new()?;
98-
let res = rt.block_on(actual_main());
94+
let res = actual_main();
95+
9996
trace!("Tokio Exited");
10097

10198
if let Err(err) = res {
@@ -107,6 +104,7 @@ fn main() -> Result<()> {
107104
}
108105
}
109106

107+
#[tokio::main]
110108
async fn actual_main() -> Result<()> {
111109
let args = cli::Args::parse();
112110
let _ = logger::setup(&args);

0 commit comments

Comments
 (0)