From f342dc81964b143e2e69c2d6eaff7ab37a293b07 Mon Sep 17 00:00:00 2001 From: link2xt Date: Tue, 31 Jan 2023 12:25:59 +0000 Subject: [PATCH] Update for new toml API --- src/accounts.rs | 3 ++- src/webxdc.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/accounts.rs b/src/accounts.rs index 79cab660b..5ea6965e0 100644 --- a/src/accounts.rs +++ b/src/accounts.rs @@ -363,7 +363,8 @@ impl Config { pub async fn from_file(file: PathBuf) -> Result { let dir = file.parent().context("can't get config file directory")?; let bytes = fs::read(&file).await.context("failed to read file")?; - let mut inner: InnerConfig = toml::from_slice(&bytes).context("failed to parse config")?; + let s = std::str::from_utf8(&bytes)?; + let mut inner: InnerConfig = toml::from_str(s).context("failed to parse config")?; // Previous versions of the core stored absolute paths in account config. // Convert them to relative paths. diff --git a/src/webxdc.rs b/src/webxdc.rs index 1413b8789..eabb0684f 100644 --- a/src/webxdc.rs +++ b/src/webxdc.rs @@ -640,7 +640,8 @@ impl Context { } fn parse_webxdc_manifest(bytes: &[u8]) -> Result { - let manifest: WebxdcManifest = toml::from_slice(bytes)?; + let s = std::str::from_utf8(bytes)?; + let manifest: WebxdcManifest = toml::from_str(s)?; Ok(manifest) }