Compile the given Exercise and return an object with information about the state of the compilation
(
exercise: &'a Exercise,
progress_bar: &'b ProgressBar,
)
| 119 | // Compile the given Exercise and return an object with information |
| 120 | // about the state of the compilation |
| 121 | fn compile<'a, 'b>( |
| 122 | exercise: &'a Exercise, |
| 123 | progress_bar: &'b ProgressBar, |
| 124 | ) -> Result<CompiledExercise<'a>, ()> { |
| 125 | let compilation_result = exercise.compile(); |
| 126 | |
| 127 | match compilation_result { |
| 128 | Ok(compilation) => Ok(compilation), |
| 129 | Err(output) => { |
| 130 | progress_bar.finish_and_clear(); |
| 131 | warn!( |
| 132 | "Compiling of {} failed! Please try again. Here's the output:", |
| 133 | exercise |
| 134 | ); |
| 135 | println!("{}", output.stderr); |
| 136 | Err(()) |
| 137 | } |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | fn prompt_for_completion(exercise: &Exercise, prompt_output: Option<String>) -> bool { |
| 142 | let context = match exercise.state() { |
no test coverage detected