1
0
Fork 0
mirror of https://gitlab.com/news-flash/article_scraper.git synced 2025-07-08 16:40:00 +02:00

port failure -> thiserror

This commit is contained in:
Jan Lukas Gernert 2022-12-01 09:22:08 +01:00
parent d906f6b7fe
commit 27be5a3204
11 changed files with 137 additions and 366 deletions

View file

@ -1,7 +1,6 @@
use crate::util::Util;
use super::error::{ConfigError, ConfigErrorKind};
use failure::ResultExt;
use super::error::ConfigError;
use std::borrow::Cow;
use std::io::Cursor;
use std::path::Path;
@ -37,9 +36,7 @@ pub struct ConfigEntry {
impl ConfigEntry {
pub async fn parse_path(config_path: &Path) -> Result<ConfigEntry, ConfigError> {
let mut file = fs::File::open(&config_path)
.await
.context(ConfigErrorKind::IO)?;
let mut file = fs::File::open(&config_path).await?;
let buffer = BufReader::new(&mut file);
Self::parse(buffer).await