Skip to content

Commit 307c4f5

Browse files
committed
apply rustfmt
1 parent 7d989e3 commit 307c4f5

File tree

1 file changed

+33
-34
lines changed
  • cosmic-settings/src/pages/display

1 file changed

+33
-34
lines changed

cosmic-settings/src/pages/display/mod.rs

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -385,47 +385,46 @@ impl page::Page<crate::pages::Message> for Page {
385385
// Start a periodic task to send identify displays message every 0.5 seconds
386386
// This resets the 1-second auto-close timer in cosmic-osd
387387
let (identifier_cancel_tx, identifier_cancel_rx) = oneshot::channel::<()>();
388-
let identifier_task =
389-
Task::stream(async_fn_stream::fn_stream(|_emitter| async move {
390-
let identifier_loop = async {
391-
loop {
392-
match tokio::process::Command::new("cosmic-osd")
393-
.arg("identify-displays")
394-
.output()
395-
.await
396-
{
397-
Ok(output) => {
398-
if !output.status.success() {
399-
tracing::error!(
400-
"cosmic-osd identify-displays failed: {}",
401-
String::from_utf8_lossy(&output.stderr)
402-
);
403-
}
404-
}
405-
Err(why) => {
388+
let identifier_task = Task::stream(async_fn_stream::fn_stream(|_emitter| async move {
389+
let identifier_loop = async {
390+
loop {
391+
match tokio::process::Command::new("cosmic-osd")
392+
.arg("identify-displays")
393+
.output()
394+
.await
395+
{
396+
Ok(output) => {
397+
if !output.status.success() {
406398
tracing::error!(
407-
why = why.to_string(),
408-
"failed to execute cosmic-osd identify-displays"
399+
"cosmic-osd identify-displays failed: {}",
400+
String::from_utf8_lossy(&output.stderr)
409401
);
410402
}
411403
}
412-
413-
tokio::time::sleep(Duration::from_millis(500)).await;
404+
Err(why) => {
405+
tracing::error!(
406+
why = why.to_string(),
407+
"failed to execute cosmic-osd identify-displays"
408+
);
409+
}
414410
}
415-
};
416411

417-
tokio::select! {
418-
_ = identifier_cancel_rx => {
419-
let _ = tokio::process::Command::new("cosmic-osd")
420-
.arg("dismiss-display-identifiers")
421-
.output()
422-
.await;
423-
}
424-
_ = identifier_loop => {
425-
// Loop will never complete, but this branch is needed for tokio::select
426-
}
412+
tokio::time::sleep(Duration::from_millis(500)).await;
413+
}
414+
};
415+
416+
tokio::select! {
417+
_ = identifier_cancel_rx => {
418+
let _ = tokio::process::Command::new("cosmic-osd")
419+
.arg("dismiss-display-identifiers")
420+
.output()
421+
.await;
422+
}
423+
_ = identifier_loop => {
424+
// Loop will never complete, but this branch is needed for tokio::select
427425
}
428-
}));
426+
}
427+
}));
429428

430429
tasks.push(identifier_task);
431430
self.display_identifier_handle = Some((identifier_cancel_tx, ()));

0 commit comments

Comments
 (0)