Skip to content

Commit 9e95e0a

Browse files
committed
test(port_riscv): 'x' as u8 -> b'x'
1 parent 58fcbb5 commit 9e95e0a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/r3_port_riscv_test_driver/src/uart_e310x.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ struct SerialWrapper<'a, UART: UartX>(&'a mut Tx<UART>);
8181
impl<UART: UartX> fmt::Write for SerialWrapper<'_, UART> {
8282
fn write_str(&mut self, s: &str) -> fmt::Result {
8383
for byte in s.as_bytes() {
84-
if *byte == '\n' as u8 {
85-
let res = block!(self.0.write('\r' as u8));
84+
if *byte == b'\n' {
85+
let res = block!(self.0.write(b'\r'));
8686

8787
if res.is_err() {
8888
return Err(::core::fmt::Error);

src/r3_port_riscv_test_driver/src/uart_k210.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ struct SerialWrapper(fn(u8));
8383
impl fmt::Write for SerialWrapper {
8484
fn write_str(&mut self, s: &str) -> fmt::Result {
8585
for byte in s.as_bytes() {
86-
if *byte == '\n' as u8 {
87-
(self.0)('\r' as u8);
86+
if *byte == b'\n' {
87+
(self.0)(b'\r');
8888
}
8989

9090
(self.0)(*byte);

src/r3_port_riscv_test_driver/src/uart_u540.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ impl SerialWrapper {
3232
impl Write for SerialWrapper {
3333
fn write_str(&mut self, s: &str) -> fmt::Result {
3434
for byte in s.as_bytes() {
35-
if *byte == '\n' as u8 {
36-
self.write_u8('\r' as u8);
35+
if *byte == b'\n' {
36+
self.write_u8(b'\r');
3737
}
3838

3939
self.write_u8(*byte);

0 commit comments

Comments
 (0)