Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update toml. #945

Merged
merged 1 commit into from
May 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 101 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ serde_derive = "1.0"
serde_json = "1.0"
shlex = "0.1"
tempfile = "3.0"
toml = "0.4.8"
toml-query = "0.7"
toml = "0.5.1"
toml-query = "0.9"

# Watch feature
notify = { version = "4.0", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ impl Config {
} else if index.starts_with("build.") {
self.build.update_value(&index[6..], value);
} else {
self.rest.insert(index, value)?;
self.rest.insert(index, value).map_err(|e| ErrorKind::TomlQueryError(e))?;
}

Ok(())
Expand Down
10 changes: 6 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,6 @@ pub mod errors {
SerdeJson(serde_json::Error) #[doc = "JSON conversion failed"];
}

links {
TomlQuery(toml_query::error::Error, toml_query::error::ErrorKind) #[doc = "A TomlQuery error"];
}

errors {
/// A subprocess exited with an unsuccessful return code.
Subprocess(message: String, output: std::process::Output) {
Expand All @@ -151,6 +147,12 @@ pub mod errors {
description("Reserved Filename")
display("{} is reserved for internal use", filename.display())
}

/// Error with a TOML file.
TomlQueryError(inner: toml_query::error::Error) {
description("toml_query error")
display("{}", inner)
}
}
}

Expand Down