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 dependency to 0.7.x #499

Merged
merged 1 commit into from
Aug 18, 2023
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
80 changes: 51 additions & 29 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 @@ -135,7 +135,7 @@ thiserror = "1.0"
tokio = "1"
tokio-tungstenite = "0.17"
tokio-util = "0.7"
toml = "0.5"
toml = "0.7.6"
tracing = "0.1.35"
tracing-appender = "0.2.2"
tracing-bunyan-formatter = "0.3.3"
Expand Down
5 changes: 4 additions & 1 deletion bin/propolis-standalone/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ pub fn block_backend(
pub fn parse(path: &str) -> anyhow::Result<Config> {
let file_data =
std::fs::read(path).context("Failed to read given config.toml")?;
Ok(toml::from_slice::<Config>(&file_data)?)
Ok(toml::from_str::<Config>(
std::str::from_utf8(&file_data)
.context("config should be valid utf-8")?,
)?)
}

pub fn parse_bdf(v: &str) -> Option<Bdf> {
Expand Down
5 changes: 4 additions & 1 deletion bin/propolis-standalone/src/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,10 @@ pub(crate) async fn restore(
let config_len = file.read_u64().await?;
let mut config_buf = vec![0; config_len.try_into()?];
file.read_exact(&mut config_buf).await?;
toml::from_slice(&config_buf)?
toml::from_str(
std::str::from_utf8(&config_buf)
.context("config should be valid utf-8")?,
)?
};

// We have enough to create the instance so let's do that first
Expand Down
Loading