mirror of
https://github.com/edera-dev/krata.git
synced 2025-09-17 10:21:31 +00:00
use constant for error comparison
This commit is contained in:
@ -1,11 +1,12 @@
|
||||
use xsd::bus::XsdBusError;
|
||||
use xsd::client::XsdClient;
|
||||
use xsd::sys::XSD_ERROR_EINVAL;
|
||||
|
||||
fn list_recursive(client: &mut XsdClient, level: usize, path: &str) -> Result<(), XsdBusError> {
|
||||
let children = match client.list(path) {
|
||||
Ok(children) => children,
|
||||
Err(error) => {
|
||||
return if error.to_string() == "EINVAL" {
|
||||
return if error.to_string() == XSD_ERROR_EINVAL.error {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(error)
|
||||
|
Reference in New Issue
Block a user