From 6507ecfc0febc0c826d3ebe6595352af5247f6b0 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Fri, 12 May 2017 16:51:48 +1000 Subject: [PATCH] Upgrade dependencies --- Cargo.toml | 4 ++-- src/lib.rs | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f01f7db..7fd9b90 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,9 +9,9 @@ description = "Run pkg-config from declarative dependencies in Cargo.toml" keywords = ["pkg-config", "build-dependencies", "build-depends", "manifest", "metadata"] [dependencies] -error-chain = { version = "0.7.1", default-features = false } +error-chain = { version = "0.10", default-features = false } pkg-config = "0.3.8" -toml = { version = "0.2", default-features = false } +toml = "0.4" [dev-dependencies] lazy_static = "0.2" diff --git a/src/lib.rs b/src/lib.rs index 699afce..4a0e979 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -47,9 +47,10 @@ pub fn probe() -> Result> { format!("Error parsing TOML from {}: {:?}", path.display(), e) )); let key = "package.metadata.pkg-config"; - let meta = try!(toml.lookup(key).ok_or( - format!("No {} in {}", key, path.display()) - )); + let meta = try!(toml.get("package") + .and_then(|v| v.get("metadata")) + .and_then(|v| v.get("pkg-config")) + .ok_or(format!("No {} in {}", key, path.display()))); let table = try!(meta.as_table().ok_or( format!("{} not a table in {}", key, path.display()) ));