Skip to content

Commit 0f27f61

Browse files
committed
improved docs
1 parent a722d8c commit 0f27f61

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tmc-client/src/tmc_client.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -438,17 +438,21 @@ impl TmcClient {
438438
}
439439
}
440440

441+
/// Waits for a submission to finish at the given URL. May require authentication
442+
///
443+
/// # Errors
444+
/// If authentication is required but the client is not authenticated, there's some problem reaching the API, or if the API returns an error.
441445
pub fn wait_for_submission_at(
442446
&self,
443447
submission_url: Url,
444448
) -> Result<SubmissionFinished, ClientError> {
445449
self.wait_for_submission_inner(|| api_v8::get_json(self, submission_url.clone(), &[]))
446450
}
447451

448-
/// Waits for a submission to finish. May require authentication.
452+
/// Waits for a submission to finish. Requires authentication.
449453
///
450454
/// # Errors
451-
/// If authentication is required but the client is not authenticated, there's some problem reaching the API, or if the API returns an error.
455+
/// If not authenticated, there's some problem reaching the API, or if the API returns an error.
452456
pub fn wait_for_submission(
453457
&self,
454458
submission_id: u32,
@@ -534,15 +538,12 @@ impl TmcClient {
534538
) -> Result<NewSubmission, ClientError> {
535539
self.require_authentication()?;
536540

537-
// compress
538541
let compressed = tmc_langs_plugins::compress_project_to_zip(submission_path)?;
539-
540542
let review = if let Some(message) = message_for_reviewer {
541543
ReviewData::WithMessage(message)
542544
} else {
543545
ReviewData::WithoutMessage
544546
};
545-
546547
api_v8::core::submit_exercise(
547548
self,
548549
exercise_id,
@@ -585,6 +586,7 @@ impl TmcClient {
585586
}
586587
}
587588

589+
// convenience functions to make sure the progress report type is correct for tmc-client
588590
fn start_stage(steps: u32, message: impl Into<String>, data: impl Into<Option<ClientUpdateData>>) {
589591
progress_reporter::start_stage(steps, message.into(), data.into())
590592
}

0 commit comments

Comments
 (0)