File tree Expand file tree Collapse file tree 4 files changed +12
-9
lines changed
tmc-testmycode-client/src/client Expand file tree Collapse file tree 4 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ fn instantiate_jvm() -> Result<JvmWrapper, JavaError> {
138138 let tmc_dir = tmc_dir ( ) ?;
139139
140140 // j4rs may panic
141- let jvm = match std:: panic:: catch_unwind ( || -> Result < Jvm , JavaError > {
141+ let catch = std:: panic:: catch_unwind ( || -> Result < Jvm , JavaError > {
142142 let jvm = JvmBuilder :: new ( )
143143 . with_base_path (
144144 tmc_dir
@@ -152,7 +152,8 @@ fn instantiate_jvm() -> Result<JvmWrapper, JavaError> {
152152 . build ( )
153153 . map_err ( JavaError :: j4rs) ?;
154154 Ok ( jvm)
155- } ) {
155+ } ) ;
156+ let jvm = match catch {
156157 Ok ( jvm_result) => jvm_result?,
157158 Err ( jvm_panic) => {
158159 // try to extract error message from panic, if any
Original file line number Diff line number Diff line change 11//! Struct modeling the test run results from R.
22
33use serde:: { Deserialize , Serialize } ;
4- use std:: collections:: HashMap ;
4+ use std:: { collections:: HashMap , fmt :: Write } ;
55use tmc_langs_framework:: { RunResult , RunStatus , TestResult } ;
66
77#[ derive( Debug , Deserialize , Serialize ) ]
@@ -21,8 +21,10 @@ impl From<RRunResult> for RunResult {
2121 r_run_result
2222 . backtrace
2323 . into_iter ( )
24- . map ( |s| format ! ( "{s}\n " ) )
25- . collect ( ) ,
24+ . fold ( String :: new ( ) , |mut output, s| {
25+ let _ = writeln ! ( output, "{s}" ) ;
26+ output
27+ } ) ,
2628 ) ;
2729 }
2830 let status = match r_run_result. run_status {
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ fn main() -> ExitCode {
2222 "TRACE" => "TRACE,reqwest=DEBUG,rustls=DEBUG" ,
2323 other => other,
2424 } ;
25- let _ = std:: env:: set_var ( "RUST_LOG" , level) ;
25+ std:: env:: set_var ( "RUST_LOG" , level) ;
2626 }
2727
2828 env_logger:: init ( ) ;
@@ -56,10 +56,11 @@ fn run() -> Result<(), ()> {
5656 }
5757 } ;
5858 let pretty = cli. pretty ;
59- match std:: panic:: catch_unwind ( || {
59+ let catch = std:: panic:: catch_unwind ( || {
6060 register_reporters ( pretty) ;
6161 tmc_langs_cli:: run ( cli)
62- } ) {
62+ } ) ;
63+ match catch {
6364 Ok ( Ok ( output) ) => {
6465 print_output ( & output, pretty, None ) . map_err ( |_| ( ) ) ?;
6566 Ok ( ( ) )
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ use serde::de::DeserializeOwned;
1313use std:: {
1414 collections:: HashMap ,
1515 io:: { Read , Write } ,
16- time:: SystemTime ,
1716} ;
1817use tmc_langs_plugins:: Language ;
1918use tmc_langs_util:: deserialize;
You can’t perform that action at this time.
0 commit comments