Skip to content

Commit c562f41

Browse files
authored
style: clean up api
- adjust some methods to private - mark some methods as unsafe - remove toggle methods - add tests
1 parent 4318d1c commit c562f41

File tree

3 files changed

+101
-199
lines changed

3 files changed

+101
-199
lines changed

uart8250/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This crate provides a struct with many methods to operate an 8250 UART.
88

99
#![no_std]
1010

11-
pub mod registers;
11+
mod registers;
1212
mod uart;
1313

14-
pub use uart::{ChipFifoInfo, InterruptType, MmioUart8250, Parity, IER, LSR, MSR};
14+
pub use uart::{ChipFifoInfo, InterruptType, MmioUart8250, Parity};

uart8250/src/registers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub struct Registers {
3636

3737
impl Registers {
3838
/// Constructs a new instance of the UART registers starting at the given base address.
39-
pub fn from_base_address(base_address: usize) -> &'static mut Self {
40-
unsafe { &mut *(base_address as *mut crate::registers::Registers) }
39+
pub unsafe fn from_base_address(base_address: usize) -> &'static mut Self {
40+
&mut *(base_address as *mut crate::registers::Registers)
4141
}
4242
}

0 commit comments

Comments
 (0)