Skip to content

Fix example in client chapter of the book

Stefano Probst requested to merge senden9/zbus:senden9-main-patch-44486 into main

There is a missing ? in one of the book examples.

As you can see in the cargo expand output new returns a result. Therefore we need to add a ? after the NotificationsProxy::new in this example block.

impl<'c> NotificationsProxy<'c> {
    #[doc = r" Creates a new proxy with the default service & path."]
    pub fn new(conn: &::zbus::Connection) -> ::zbus::Result<Self> {
        Ok(Self(::zbus::Proxy::new(
            conn,
            "org.freedesktop.Notifications",
            "/org/freedesktop/Notifications",
            "org.freedesktop.Notifications",
        )?))
    }

Tested with zbus = "2.0.0-beta.3" and zvariant = "2.6.0".

Merge request reports

Loading