Skip to content

Commit

Permalink
fix: allow sharing ParseError across threads
Browse files Browse the repository at this point in the history
Signed-off-by: Amin Yahyaabadi <aminyahyaabadi74@gmail.com>
  • Loading branch information
aminya committed Nov 20, 2023
1 parent 02e1115 commit 5d75d44
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use thiserror::Error;

use crate::{task::Task, Action};
use std::{collections::HashMap, error::Error};
use std::collections::HashMap;

/// Generic parser traits. If users want to customize the configuration file parser, they must implement this trait.
/// The yaml module's `YamlParser` is an example.
Expand Down Expand Up @@ -33,10 +33,10 @@ pub trait Parser {
/// By default, a conversion from `String` type to [`ParseError`] is provided.
#[derive(Debug, Error)]
#[error("{0}")]
pub struct ParseError(pub Box<dyn Error>);
pub struct ParseError(pub String);

impl From<String> for ParseError {
fn from(value: String) -> Self {
ParseError(value.into())
ParseError(value)
}
}

0 comments on commit 5d75d44

Please sign in to comment.