@@ -48,68 +48,3 @@ pub enum Source {
4848 } ,
4949 Path ( std:: path:: PathBuf ) ,
5050}
51-
52- pub type RunResult = Result < ( ) , RunError > ;
53-
54- #[ derive( Debug ) ]
55- pub struct RunError {
56- status : notify:: MessageKind ,
57- cause : Option < Box < dyn std:: error:: Error + Send + Sync + ' static > > ,
58- }
59-
60- impl RunError {
61- pub fn with_cause ( cause : impl std:: error:: Error + Send + Sync + ' static ) -> Self {
62- Self {
63- status : notify:: MessageKind :: Error ,
64- cause : Some ( Box :: new ( cause) ) ,
65- }
66- }
67-
68- pub fn fail ( cause : impl std:: fmt:: Display ) -> Self {
69- Self :: with_cause ( Message ( cause. to_string ( ) ) )
70- }
71-
72- /// Should not be called with `libtest_lexarg::RunIgnored::Yes`
73- pub fn ignore ( ) -> Self {
74- Self {
75- status : notify:: MessageKind :: Ignored ,
76- cause : None ,
77- }
78- }
79-
80- /// Should not be called with `libtest_lexarg::RunIgnored::Yes`
81- pub fn ignore_for ( reason : String ) -> Self {
82- Self {
83- status : notify:: MessageKind :: Ignored ,
84- cause : Some ( Box :: new ( Message ( reason) ) ) ,
85- }
86- }
87-
88- pub ( crate ) fn status ( & self ) -> notify:: MessageKind {
89- self . status
90- }
91-
92- pub ( crate ) fn cause ( & self ) -> Option < & ( dyn std:: error:: Error + Send + Sync ) > {
93- self . cause . as_ref ( ) . map ( |b| b. as_ref ( ) )
94- }
95- }
96-
97- impl < E > From < E > for RunError
98- where
99- E : std:: error:: Error + Send + Sync + ' static ,
100- {
101- fn from ( error : E ) -> Self {
102- Self :: with_cause ( error)
103- }
104- }
105-
106- #[ derive( Debug ) ]
107- struct Message ( String ) ;
108-
109- impl std:: fmt:: Display for Message {
110- fn fmt ( & self , formatter : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
111- self . 0 . fmt ( formatter)
112- }
113- }
114-
115- impl std:: error:: Error for Message { }
0 commit comments