tanakh / cargo-atcoder

Cargo subcommand for AtCoder
BSD 3-Clause "New" or "Revised" License
397 stars 36 forks source link

Show compile error if compilation fails #64

Open ajfAfg opened 2 years ago

ajfAfg commented 2 years ago

TODO.md に記述されている「コンパイルエラー時はエラーメッセージも取得したい」を解決しました. コンパイルエラー時は以下のように表示されます.

Submission detail:

Submission ID: 30210056
Date:          2022-03-18 23:29:18
Problem:       PracticeA - Welcome to AtCoder
Language:      Rust (1.42.0)
Score:         0
Code length:   356 Byte
Result:        Compile Error
Runtime:       N/A
Memory:        N/A

Compile Error:
error[E0277]: `[i32; 3]` is not an iterator
 --> src/main.rs:8:14
  |
8 |     for v in [a, b, c] {
  |              ^^^^^^^^^ borrow the array with `&` or call `.iter()` on it to iterate over it
  |
  = help: the trait `std::iter::Iterator` is not implemented for `[i32; 3]`
  = note: arrays are not iterators, but slices like the following are: `&[1, 2, 3]`
  = note: required by `std::iter::IntoIterator::into_iter`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
error: could not compile `main`.

To learn more, run the command again with --verbose.

しかし,表示はできているものの少し見づらいと感じているので,何か見やすくするためのアイデアをいただきたいです.