Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3df5d10

Browse files
authored
fix: dont log error if notify panics
1 parent 115338d commit 3df5d10

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

synth/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ async fn main() -> Result<()> {
1111
let args = Args::from_args();
1212
let cli = Cli::new()?;
1313

14-
let notify_handle = thread::spawn(|| synth::version::notify_new_version_message().unwrap());
14+
let notify_handle = thread::spawn(synth::version::notify_new_version_message);
1515

1616
#[cfg(feature = "telemetry")]
1717
synth::cli::telemetry::with_telemetry(args, |args| cli.run(args)).await?;
@@ -24,8 +24,8 @@ async fn main() -> Result<()> {
2424
Ok(())
2525
}
2626

27-
fn print_notify(handle: JoinHandle<Option<String>>) {
28-
if let Some(notify_message) = handle.join().unwrap_or_default() {
27+
fn print_notify(handle: JoinHandle<Result<Option<String>>>) {
28+
if let Ok(Ok(Some(notify_message))) = handle.join() {
2929
eprintln!("{}", notify_message);
3030
}
3131
}

0 commit comments

Comments
 (0)