use constant for error comparison

This commit is contained in:
Alex Zenla committed 2024-01-08 14:16:33 -08:00
1 parent f8938ac2c6
commit 8e2fc80ee0
3 files changed
+22 -24

No files matched your search

+2 -1
View File
@@ -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)