diff options
| author | mo8it <mo8it@proton.me> | 2024-04-12 01:24:01 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-04-12 01:24:01 +0200 |
| commit | 2a95a3e96644a0f769019204a518816c9f2e2aee (patch) | |
| tree | 44a0f35cf3fc63d39346433af568451e501b4628 /src/exercise.rs | |
| parent | 1e3745ccdf5ca41ae47d4f4d8594e8070df200a5 (diff) | |
Deal with long strings
Diffstat (limited to 'src/exercise.rs')
| -rw-r--r-- | src/exercise.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/exercise.rs b/src/exercise.rs index f01c6fc..d28f4db 100644 --- a/src/exercise.rs +++ b/src/exercise.rs @@ -24,6 +24,10 @@ pub enum Mode { #[derive(Deserialize)] #[serde(deny_unknown_fields)] pub struct InfoFile { + // TODO + pub welcome_message: Option<String>, + // TODO + pub final_message: Option<String>, pub exercises: Vec<Exercise>, } @@ -39,10 +43,7 @@ impl InfoFile { .context("Failed to parse `info.toml`")?; if slf.exercises.is_empty() { - panic!( - "There are no exercises yet! -If you are developing third-party exercises, add at least one exercise before testing." - ); + panic!("{NO_EXERCISES_ERR}"); } Ok(slf) @@ -119,3 +120,6 @@ impl Display for Exercise { self.path.fmt(f) } } + +const NO_EXERCISES_ERR: &str = "There are no exercises yet! +If you are developing third-party exercises, add at least one exercise before testing."; |
