Skip to content

Commit 4c8697f

Browse files
committed
fixes
1 parent fbe33de commit 4c8697f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

tmc-langs-core/src/response.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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
3940
pub 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
4648
pub 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>,

tmc-langs-core/src/tmc_core/api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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))?;

0 commit comments

Comments
 (0)