Commit 6382220
Remove 'Press any key to exit' in basic-rs and basic-cpp templates (#4468)
The basic-rs and basic-cpp templates say "Press any key to exit..." but
stdin is line-buffered in cooked mode, so `read(&mut [0u8])` actually
blocks until Enter is pressed.
Adding a real "any key" handler would require a terminal crate
dependency (crossterm, termion, etc.) which is heavy for a starter
template. Instead, change the message to "Press Enter to exit..." and
use `read_line()` to match the actual behavior.
Also removes the unused `Read` import.
Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>1 parent ebea9a4 commit 6382220
2 files changed
Lines changed: 8 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
| |||
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
46 | 46 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
| |||
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
46 | 46 | | |
0 commit comments