Skip to content

Commit

Permalink
Don't allow unreachable_patterns
Browse files Browse the repository at this point in the history
The warning happening in beta will be rolled back (for now) according to
rust-lang/rust#129352 (comment)

Until this change propagates to a beta release, we can live with the
warnings.
  • Loading branch information
jannic committed Sep 10, 2024
1 parent fb6b977 commit b1a5966
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 6 deletions.
1 change: 0 additions & 1 deletion rp2040-hal/src/uart/peripheral.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ impl<D: UartDevice, P: ValidUartPinout<D>> Write<u8> for UartPeripheral<Enabled,
}

fn flush(&mut self) -> nb::Result<(), Self::Error> {
#[allow(unreachable_patterns)]
super::writer::transmit_flushed(&self.device).map_err(|e| match e {
WouldBlock => WouldBlock,
Other(v) => match v {},
Expand Down
2 changes: 0 additions & 2 deletions rp2040-hal/src/uart/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ pub(crate) fn write_raw<'d>(
pub(crate) fn write_full_blocking(rb: &RegisterBlock, data: &[u8]) {
let mut temp = data;

#[allow(unreachable_patterns)]
while !temp.is_empty() {
temp = match write_raw(rb, temp) {
Ok(remaining) => remaining,
Expand Down Expand Up @@ -280,7 +279,6 @@ impl<D: UartDevice, P: ValidUartPinout<D>> Write<u8> for Writer<D, P> {
}

fn flush(&mut self) -> nb::Result<(), Self::Error> {
#[allow(unreachable_patterns)]
transmit_flushed(&self.device).map_err(|e| match e {
WouldBlock => WouldBlock,
Other(v) => match v {},
Expand Down
1 change: 0 additions & 1 deletion rp235x-hal/src/uart/peripheral.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ impl<D: UartDevice, P: ValidUartPinout<D>> Write<u8> for UartPeripheral<Enabled,
}

fn flush(&mut self) -> nb::Result<(), Self::Error> {
#[allow(unreachable_patterns)]
super::writer::transmit_flushed(&self.device).map_err(|e| match e {
WouldBlock => WouldBlock,
Other(v) => match v {},
Expand Down
2 changes: 0 additions & 2 deletions rp235x-hal/src/uart/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ pub(crate) fn write_raw<'d>(
pub(crate) fn write_full_blocking(rb: &RegisterBlock, data: &[u8]) {
let mut temp = data;

#[allow(unreachable_patterns)]
while !temp.is_empty() {
temp = match write_raw(rb, temp) {
Ok(remaining) => remaining,
Expand Down Expand Up @@ -281,7 +280,6 @@ impl<D: UartDevice, P: ValidUartPinout<D>> Write<u8> for Writer<D, P> {
}

fn flush(&mut self) -> nb::Result<(), Self::Error> {
#[allow(unreachable_patterns)]
transmit_flushed(&self.device).map_err(|e| match e {
WouldBlock => WouldBlock,
Other(v) => match v {},
Expand Down

0 comments on commit b1a5966

Please sign in to comment.