Skip to content

Commit

Permalink
improving readability of the serial port
Browse files Browse the repository at this point in the history
  • Loading branch information
stlankes committed May 2, 2024
1 parent 60fa651 commit a46f20b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions src/arch/aarch64/serial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ pub struct ComPort {

impl ComPort {
/// Create a new COM port with the specified base address.
const fn new(base_addr: u32) -> ComPort {
ComPort {
base_addr: base_addr,
}
const fn new(base_addr: u32) -> Self {
Self { base_addr }
}
}

Expand Down
6 changes: 2 additions & 4 deletions src/arch/x86_64/serial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ pub struct ComPort {

impl ComPort {
/// Create a new COM port with the specified base address.
const fn new(base_addr: u16) -> ComPort {
ComPort {
base_addr: base_addr,
}
const fn new(base_addr: u16) -> Self {
Self { base_addr }
}
}

Expand Down

0 comments on commit a46f20b

Please sign in to comment.