Skip to content

Commit 11aecef

Browse files
committed
Update toml to 0.8
1 parent 92c3399 commit 11aecef

File tree

5 files changed

+79
-13
lines changed

5 files changed

+79
-13
lines changed

Cargo.lock

Lines changed: 71 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ hex = "0.4"
1818
parser = { path = "parser" }
1919
rust_team_data = { git = "https://github.com/rust-lang/team" }
2020
glob = "0.3.0"
21-
toml = "0.5.1"
21+
toml = "0.8.8"
2222
hyper = { version = "0.14.4", features = ["server", "stream"]}
2323
tokio = { version = "1.7.1", features = ["macros", "time", "rt"] }
2424
futures = { version = "0.3", default-features = false, features = ["std"] }

src/config.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,8 @@ async fn get_fresh_config(
307307
.await
308308
.map_err(|e| ConfigurationError::Http(Arc::new(e)))?
309309
.ok_or(ConfigurationError::Missing)?;
310-
let config = Arc::new(toml::from_slice::<Config>(&contents).map_err(ConfigurationError::Toml)?);
310+
let contents = String::from_utf8_lossy(&*contents);
311+
let config = Arc::new(toml::from_str::<Config>(&contents).map_err(ConfigurationError::Toml)?);
311312
log::debug!("fresh configuration for {}: {:?}", repo.full_name, config);
312313
Ok(config)
313314
}

src/handlers/assign/tests/tests_candidates.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use super::super::*;
44

55
/// Basic test function for testing `candidate_reviewers_from_names`.
66
fn test_from_names(
7-
teams: Option<toml::Value>,
8-
config: toml::Value,
7+
teams: Option<toml::Table>,
8+
config: toml::Table,
99
issue: serde_json::Value,
1010
names: &[&str],
1111
expected: Result<&[&str], FindReviewerError>,
@@ -32,8 +32,8 @@ fn test_from_names(
3232

3333
/// Convert the simplified input in preparation for `candidate_reviewers_from_names`.
3434
fn convert_simplified(
35-
teams: Option<toml::Value>,
36-
config: toml::Value,
35+
teams: Option<toml::Table>,
36+
config: toml::Table,
3737
issue: serde_json::Value,
3838
) -> (Teams, AssignConfig, Issue) {
3939
// Convert the simplified team config to a real team config.

src/handlers/assign/tests/tests_from_diff.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::config::AssignConfig;
55
use crate::github::parse_diff;
66
use std::fmt::Write;
77

8-
fn test_from_diff(diff: &str, config: toml::Value, expected: &[&str]) {
8+
fn test_from_diff(diff: &str, config: toml::Table, expected: &[&str]) {
99
let files = parse_diff(diff);
1010
let aconfig: AssignConfig = config.try_into().unwrap();
1111
assert_eq!(

0 commit comments

Comments
 (0)