File tree 3 files changed +49
-5
lines changed
3 files changed +49
-5
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version" : " 0.2.0" ,
6
+ "configurations" : [
7
+ {
8
+ "type" : " lldb" ,
9
+ "request" : " launch" ,
10
+ "name" : " Debug executable 'eva01'" ,
11
+ "cargo" : {
12
+ "args" : [
13
+ " build" ,
14
+ " --bin=eva01" ,
15
+ " --package=eva01"
16
+ ],
17
+ "filter" : {
18
+ "name" : " eva01" ,
19
+ "kind" : " bin"
20
+ }
21
+ },
22
+ "args" : [" run" , " cfg.toml" ],
23
+ "cwd" : " ${workspaceFolder}"
24
+ },
25
+ {
26
+ "type" : " lldb" ,
27
+ "request" : " launch" ,
28
+ "name" : " Debug unit tests in executable 'eva01'" ,
29
+ "cargo" : {
30
+ "args" : [
31
+ " test" ,
32
+ " --no-run" ,
33
+ " --bin=eva01" ,
34
+ " --package=eva01"
35
+ ],
36
+ "filter" : {
37
+ "name" : " eva01" ,
38
+ "kind" : " bin"
39
+ }
40
+ },
41
+ "args" : [],
42
+ "cwd" : " ${workspaceFolder}"
43
+ }
44
+ ]
45
+ }
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ pub async fn main_entry() -> anyhow::Result<()> {
17
17
18
18
match args. cmd {
19
19
app:: Commands :: Run { path } => {
20
- let config = Eva01Config :: try_load_from_file ( path) . unwrap ( ) ;
20
+ let config = Eva01Config :: try_load_from_file ( path) ? ;
21
21
entrypoints:: run_liquidator ( config) . await ?;
22
22
}
23
23
app:: Commands :: Setup => {
Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ use fixed::types::I80F48;
10
10
use fixed_macro:: types:: I80F48 ;
11
11
use solana_sdk:: { pubkey, pubkey:: Pubkey } ;
12
12
use std:: {
13
- error:: Error ,
14
13
io:: { BufWriter , Write } ,
15
14
path:: PathBuf ,
16
15
} ;
@@ -25,11 +24,11 @@ pub struct Eva01Config {
25
24
}
26
25
27
26
impl Eva01Config {
28
- pub fn try_load_from_file ( path : PathBuf ) -> Result < Self , Box < dyn Error > > {
27
+ pub fn try_load_from_file ( path : PathBuf ) -> anyhow :: Result < Self > {
29
28
let config_str = std:: fs:: read_to_string ( path)
30
- . map_err ( |e| format ! ( "Failed to read config file: {:?}" , e) ) ?;
29
+ . map_err ( |e| anyhow :: anyhow !( "Failed to read config file: {:# ?}" , e) ) ?;
31
30
let config = toml:: from_str ( & config_str)
32
- . map_err ( |e| format ! ( "Failed to parse config file {:?}" , e) ) ?;
31
+ . map_err ( |e| anyhow :: anyhow !( "Failed to parse config file {:# ?}" , e) ) ?;
33
32
Ok ( config)
34
33
}
35
34
You can’t perform that action at this time.
0 commit comments