projects
/
cargo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2a2f95d
)
Utilize `if let` construct over single branch `match`.
author
Corey Farwell
<coreyf@rwell.org>
Tue, 3 May 2016 01:18:14 +0000
(21:18 -0400)
committer
Corey Farwell
<coreyf@rwell.org>
Tue, 3 May 2016 01:18:14 +0000
(21:18 -0400)
src/cargo/util/toml.rs
patch
|
blob
|
history
diff --git
a/src/cargo/util/toml.rs
b/src/cargo/util/toml.rs
index 288aa2be59a539d84ced55b688990f932fb058fa..5e0d3868e39c306faf2a0906a1a3345cb284a446 100644
(file)
--- a/
src/cargo/util/toml.rs
+++ b/
src/cargo/util/toml.rs
@@
-156,9
+156,8
@@
pub fn to_manifest(contents: &[u8],
pub fn parse(toml: &str, file: &Path) -> CargoResult<toml::Table> {
let mut parser = toml::Parser::new(&toml);
- match parser.parse() {
- Some(toml) => return Ok(toml),
- None => {}
+ if let Some(toml) = parser.parse() {
+ return Ok(toml);
}
let mut error_str = format!("could not parse input as TOML\n");
for error in parser.errors.iter() {