Skip to content

Commit

Permalink
Merge pull request #1349 from eclipse-zenoh/fix-backend-search-dirs
Browse files Browse the repository at this point in the history
Fix erroneous parsing of `backend_search_dirs`
  • Loading branch information
fuzzypixelz authored Sep 3, 2024
2 parents e2f366c + a7d03b7 commit a8de5bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/zenoh-backend-traits/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ impl<S: Into<String> + AsRef<str>, V: AsObject> TryFrom<(S, &V)> for PluginConfi
})
})
.unwrap_or(Ok(true))?;
// TODO(fuzzypixelz): refactor this function's interface to get access to the configuration
// source, this we can support spec syntax in the lib search dir.
let backend_search_dirs = match value.get("backend_search_dirs") {
Some(serde_json::Value::String(path)) => LibSearchDirs::from_paths(&[path.clone()]),
Some(serde_json::Value::Array(paths)) => {
Expand All @@ -174,7 +176,7 @@ impl<S: Into<String> + AsRef<str>, V: AsObject> TryFrom<(S, &V)> for PluginConfi
};
specs.push(path.clone());
}
LibSearchDirs::from_specs(&specs)?
LibSearchDirs::from_paths(&specs)
}
None => LibSearchDirs::default(),
_ => bail!("`backend_search_dirs` field of {}'s configuration must be a string or array of strings", name.as_ref())
Expand Down

0 comments on commit a8de5bc

Please sign in to comment.