Skip to main content

problemo/common/
problem.rs

1use super::{super::problem::*, common::*};
2
3//
4// IntoCommonProblem
5//
6
7/// Into a common [Problem].
8pub trait IntoCommonProblem {
9    /// Into a [GlossError] problem.
10    fn gloss(self) -> Problem;
11
12    /// Into a [ThreadError] problem.
13    fn into_thread_problem(self) -> Problem;
14}
15
16impl<ToStringT> IntoCommonProblem for ToStringT
17where
18    ToStringT: ToString,
19{
20    #[track_caller]
21    fn gloss(self) -> Problem {
22        GlossError::as_problem(self)
23    }
24
25    #[track_caller]
26    fn into_thread_problem(self) -> Problem {
27        ThreadError::as_problem(self)
28    }
29}