1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2024-12-15 06:20:32 +02:00

Disambiguate b in main_improved.rs (#977)

Based on #761.
This commit is contained in:
Martin Geisler 2023-07-14 13:01:00 +02:00 committed by GitHub
parent f00711d333
commit 677e1feae1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,9 +38,9 @@ extern "C" fn main(x0: u64, x1: u64, x2: u64, x3: u64) {
writeln!(uart, "main({x0:#x}, {x1:#x}, {x2:#x}, {x3:#x})").unwrap();
loop {
if let Some(b) = uart.read_byte() {
uart.write_byte(b);
match b {
if let Some(byte) = uart.read_byte() {
uart.write_byte(byte);
match byte {
b'\r' => {
uart.write_byte(b'\n');
}