mirror of
https://github.com/chatmail/core.git
synced 2026-05-13 03:46:32 +03:00
Update for new toml API
This commit is contained in:
@@ -363,7 +363,8 @@ impl Config {
|
|||||||
pub async fn from_file(file: PathBuf) -> Result<Self> {
|
pub async fn from_file(file: PathBuf) -> Result<Self> {
|
||||||
let dir = file.parent().context("can't get config file directory")?;
|
let dir = file.parent().context("can't get config file directory")?;
|
||||||
let bytes = fs::read(&file).await.context("failed to read file")?;
|
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.
|
// Previous versions of the core stored absolute paths in account config.
|
||||||
// Convert them to relative paths.
|
// Convert them to relative paths.
|
||||||
|
|||||||
@@ -640,7 +640,8 @@ impl Context {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn parse_webxdc_manifest(bytes: &[u8]) -> Result<WebxdcManifest> {
|
fn parse_webxdc_manifest(bytes: &[u8]) -> Result<WebxdcManifest> {
|
||||||
let manifest: WebxdcManifest = toml::from_slice(bytes)?;
|
let s = std::str::from_utf8(bytes)?;
|
||||||
|
let manifest: WebxdcManifest = toml::from_str(s)?;
|
||||||
Ok(manifest)
|
Ok(manifest)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user