File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -36,13 +36,15 @@ impl<T> Response<T> {
3636/// Represents an error response from tmc-server
3737#[ derive( Debug , Error , Deserialize ) ]
3838#[ error( "Response contained errors: {errors:#?}" ) ]
39+ #[ serde( deny_unknown_fields) ] // prevents responses with an errors field from being parsed as an error
3940pub struct ResponseErrors {
4041 pub errors : Vec < String > ,
4142}
4243
4344/// Represents an error response from tmc-server
4445#[ derive( Debug , Error , Deserialize ) ]
4546#[ error( "Response contained an error: {error:#?}" ) ]
47+ #[ serde( deny_unknown_fields) ] // prevents responses with an error field from being parsed as an error
4648pub struct ResponseError {
4749 pub error : String ,
4850}
@@ -304,7 +306,7 @@ pub struct SubmissionFinished {
304306 pub submission_url : String ,
305307 pub solution_url : Option < String > ,
306308 pub submitted_at : String ,
307- pub processing_time : usize ,
309+ pub processing_time : Option < usize > ,
308310 pub reviewed : bool ,
309311 pub requests_review : bool ,
310312 pub paste_url : Option < String > ,
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ impl TmcCore {
103103 Ok ( ( ) )
104104 }
105105
106- pub fn download_from ( & self , url : Url , target : & Path ) -> Result < ( ) > {
106+ pub ( crate ) fn download_from ( & self , url : Url , target : & Path ) -> Result < ( ) > {
107107 // download zip
108108 let mut target_file =
109109 File :: create ( target) . map_err ( |e| CoreError :: FileCreate ( target. to_path_buf ( ) , e) ) ?;
You can’t perform that action at this time.
0 commit comments