Skip to content

Commit eae5d19

Browse files
Merge pull request #421 from mehcode/dependabot/cargo/toml-0.7
Update toml requirement from 0.5 to 0.7
2 parents af48f39 + 53c8008 commit eae5d19

File tree

5 files changed

+9
-56
lines changed

5 files changed

+9
-56
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ serde = "1.0.8"
3030
nom = "7"
3131

3232
async-trait = { version = "0.1.50", optional = true }
33-
toml = { version = "0.5", optional = true }
33+
toml = { version = "0.7", optional = true }
3434
serde_json = { version = "1.0.2", optional = true }
3535
yaml-rust = { version = "0.4", optional = true }
3636
rust-ini = { version = "0.18", optional = true }

tests/errors.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,11 @@ fn test_error_parse() {
1919
.add_source(File::new("tests/Settings-invalid", FileFormat::Toml))
2020
.build();
2121

22-
let path: PathBuf = ["tests", "Settings-invalid.toml"].iter().collect();
23-
2422
assert!(res.is_err());
25-
assert_eq!(
26-
res.unwrap_err().to_string(),
27-
format!(
28-
"invalid TOML value, did you mean to use a quoted string? at line 2 column 9 in {}",
29-
path.display()
30-
)
31-
);
23+
assert!(res
24+
.unwrap_err()
25+
.to_string()
26+
.contains("TOML parse error at line 2, column 9"));
3227
}
3328

3429
#[test]

tests/file_toml.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
use serde_derive::Deserialize;
44

5-
use std::path::PathBuf;
6-
75
use config::{Config, File, FileFormat, Map, Value};
86
use float_cmp::ApproxEqUlps;
97

@@ -90,16 +88,11 @@ fn test_error_parse() {
9088
.add_source(File::new("tests/Settings-invalid", FileFormat::Toml))
9189
.build();
9290

93-
let path_with_extension: PathBuf = ["tests", "Settings-invalid.toml"].iter().collect();
94-
9591
assert!(res.is_err());
96-
assert_eq!(
97-
res.unwrap_err().to_string(),
98-
format!(
99-
"invalid TOML value, did you mean to use a quoted string? at line 2 column 9 in {}",
100-
path_with_extension.display()
101-
)
102-
);
92+
assert!(res
93+
.unwrap_err()
94+
.to_string()
95+
.contains("TOML parse error at line 2, column 9"));
10396
}
10497

10598
#[derive(Debug, Deserialize, PartialEq)]

tests/legacy/errors.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,6 @@ fn make() -> Config {
1414
c
1515
}
1616

17-
#[test]
18-
fn test_error_parse() {
19-
let mut c = Config::default();
20-
let res = c.merge(File::new("tests/Settings-invalid", FileFormat::Toml));
21-
22-
let path: PathBuf = ["tests", "Settings-invalid.toml"].iter().collect();
23-
24-
assert!(res.is_err());
25-
assert_eq!(
26-
res.unwrap_err().to_string(),
27-
format!(
28-
"invalid TOML value, did you mean to use a quoted string? at line 2 column 9 in {}",
29-
path.display()
30-
)
31-
);
32-
}
33-
3417
#[test]
3518
fn test_error_type() {
3619
let c = make();

tests/legacy/file_toml.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#![cfg(feature = "toml")]
22

33
use serde_derive::Deserialize;
4-
use std::path::PathBuf;
54

65
use config::{Config, File, FileFormat, Map, Value};
76
use float_cmp::ApproxEqUlps;
@@ -83,20 +82,3 @@ fn test_file() {
8382
);
8483
}
8584
}
86-
87-
#[test]
88-
fn test_error_parse() {
89-
let mut c = Config::default();
90-
let res = c.merge(File::new("tests/Settings-invalid", FileFormat::Toml));
91-
92-
let path_with_extension: PathBuf = ["tests", "Settings-invalid.toml"].iter().collect();
93-
94-
assert!(res.is_err());
95-
assert_eq!(
96-
res.unwrap_err().to_string(),
97-
format!(
98-
"invalid TOML value, did you mean to use a quoted string? at line 2 column 9 in {}",
99-
path_with_extension.display()
100-
)
101-
);
102-
}

0 commit comments

Comments
 (0)