Skip to content

Fix incorrect key type in return type of get_managed_objects()

Tim Small requested to merge TimSmall/zbus:fdo-ManagedObjects-type-fix into master

get_managed_objects() previously returned a dict keyed on String instead of OwnedObjectPath, causing runtime deserialization errors.

Code which triggered this bug:

use std::error::Error;

fn main() -> Result<(), Box<dyn Error>> {
    let connection = zbus::Connection::new_system().unwrap();
    let om = zbus::fdo::ObjectManagerProxy::new_for(&connection, "org.freedesktop.ModemManager1", "/org/freedesktop/ModemManager1")?;
    match om.get_managed_objects() {
        Ok(ob) => {
            println!("Found {} objects.", ob.len());
        },
        Err(e) => panic!("Get managed objects Failed: {:?}", e),
    }
    Ok(())
}

Merge request reports

Loading