-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinterfaceerror.rs
More file actions
41 lines (36 loc) · 997 Bytes
/
Copy pathinterfaceerror.rs
File metadata and controls
41 lines (36 loc) · 997 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//^
//^ HEAD
//^
//> HEAD -> LIBUTILS
use libutils::issuing::Issue;
//>
//^ INTERFACEERROR
//^
//> INTERFACEERROR -> ENUM
pub enum InterfaceError {
UnknownTarget {
name: &'static str
},
TargetNotProvided,
IncorrectLatexArguments
}
//> INTERFACEERROR -> INTO ISSUE
impl Into<Issue> for InterfaceError {
fn into(self) -> Issue {return match self {
InterfaceError::UnknownTarget {name} => Issue {
name: "unknown target",
description: Some(format!("unknown target found: {name:?}")),
..
},
InterfaceError::TargetNotProvided => Issue {
name: "target not provided",
description: Some(String::from("interpreter target was not provided")),
..
},
Self::IncorrectLatexArguments => Issue {
name: "incorrect arguments for latex",
description: Some(format!("usage: `mathsys latex (FILE)`")),
..
}
}.assert_normal()}
}