Skip to content

Commit 8f1fcbb

Browse files
authored
Merge pull request #485 from stephin-thomas/patch-2
Update tokio_server_cr.rs
2 parents a24953b + 80172ba commit 8f1fcbb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

dbus-tokio/examples/tokio_server_cr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ pub async fn main() -> Result<(), Box<dyn std::error::Error>> {
1515
// The instance is configured so that introspection and properties interfaces
1616
// are added by default on object path additions.
1717
let mut cr = Crossroads::new();
18-
let (_, c) = connection::new_session_sync()?;
18+
// Connect to the D-Bus session bus (this is blocking, unfortunately).
19+
let (resource, c) = connection::new_session_sync()?;
1920

2021

2122
// Enable async support for the crossroads instance.
@@ -53,8 +54,7 @@ pub async fn main() -> Result<(), Box<dyn std::error::Error>> {
5354
// to the crossroads instance.
5455
cr.insert("/hello", &[iface_token], Hello { called_count: 0});
5556

56-
// Connect to the D-Bus session bus (this is blocking, unfortunately).
57-
let (resource, c) = connection::new_session_sync()?;
57+
5858

5959
// We add the Crossroads instance to the connection so that incoming method calls will be handled.
6060
c.start_receive(MatchRule::new_method_call(), Box::new(move |msg, conn| {

0 commit comments

Comments
 (0)