Skip to content

Commit

Permalink
Update toml to 0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Jan 22, 2024
1 parent 92c3399 commit 11aecef
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 13 deletions.
77 changes: 71 additions & 6 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ hex = "0.4"
parser = { path = "parser" }
rust_team_data = { git = "https://github.com/rust-lang/team" }
glob = "0.3.0"
toml = "0.5.1"
toml = "0.8.8"
hyper = { version = "0.14.4", features = ["server", "stream"]}
tokio = { version = "1.7.1", features = ["macros", "time", "rt"] }
futures = { version = "0.3", default-features = false, features = ["std"] }
Expand Down
3 changes: 2 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@ async fn get_fresh_config(
.await
.map_err(|e| ConfigurationError::Http(Arc::new(e)))?
.ok_or(ConfigurationError::Missing)?;
let config = Arc::new(toml::from_slice::<Config>(&contents).map_err(ConfigurationError::Toml)?);
let contents = String::from_utf8_lossy(&*contents);
let config = Arc::new(toml::from_str::<Config>(&contents).map_err(ConfigurationError::Toml)?);
log::debug!("fresh configuration for {}: {:?}", repo.full_name, config);
Ok(config)
}
Expand Down
8 changes: 4 additions & 4 deletions src/handlers/assign/tests/tests_candidates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use super::super::*;

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

/// Convert the simplified input in preparation for `candidate_reviewers_from_names`.
fn convert_simplified(
teams: Option<toml::Value>,
config: toml::Value,
teams: Option<toml::Table>,
config: toml::Table,
issue: serde_json::Value,
) -> (Teams, AssignConfig, Issue) {
// Convert the simplified team config to a real team config.
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/assign/tests/tests_from_diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::config::AssignConfig;
use crate::github::parse_diff;
use std::fmt::Write;

fn test_from_diff(diff: &str, config: toml::Value, expected: &[&str]) {
fn test_from_diff(diff: &str, config: toml::Table, expected: &[&str]) {
let files = parse_diff(diff);
let aconfig: AssignConfig = config.try_into().unwrap();
assert_eq!(
Expand Down

0 comments on commit 11aecef

Please sign in to comment.