remove unsafe API
shared-hal-ci / Check build (push) Has been cancelled
shared-hal-ci / Check formatting (push) Has been cancelled
shared-hal-ci / Check Documentation Build (push) Has been cancelled
shared-hal-ci / Clippy (push) Has been cancelled
va108xx-ci / Run Tests (push) Has been cancelled
va108xx-ci / Check formatting (push) Has been cancelled
va108xx-ci / Check Documentation Build (push) Has been cancelled
va108xx-ci / Clippy (push) Has been cancelled
va416xx-ci / Run Tests (push) Has been cancelled
va416xx-ci / Check formatting (push) Has been cancelled
va416xx-ci / Check Documentation Build (push) Has been cancelled
va416xx-ci / Clippy (push) Has been cancelled
shared-hal-ci / Check build (pull_request) Has been cancelled
shared-hal-ci / Check formatting (pull_request) Has been cancelled
shared-hal-ci / Check Documentation Build (pull_request) Has been cancelled
shared-hal-ci / Clippy (pull_request) Has been cancelled
va108xx-ci / Run Tests (pull_request) Has been cancelled
va108xx-ci / Check formatting (pull_request) Has been cancelled
va108xx-ci / Check Documentation Build (pull_request) Has been cancelled
va108xx-ci / Clippy (pull_request) Has been cancelled
va416xx-ci / Run Tests (pull_request) Has been cancelled
va416xx-ci / Check formatting (pull_request) Has been cancelled
va416xx-ci / Check Documentation Build (pull_request) Has been cancelled
va416xx-ci / Clippy (pull_request) Has been cancelled
va108xx-ci / Check build (push) Has been cancelled
va416xx-ci / Check build (push) Has been cancelled
va108xx-ci / Check build (pull_request) Has been cancelled
va416xx-ci / Check build (pull_request) Has been cancelled

This commit is contained in:
Robin Mueller committed 2026-06-22 16:29:10 +02:00
1 parent 6978a98f76
commit 1ab885a7d5
2 files changed
+5 -3

No files matched your search

+2 -1
View File
@@ -614,7 +614,8 @@ impl SpiAsync {
///
/// The user MUST ensure that the `Drop` method of all futures generated with this driver
/// is called on transfer cancellation. By default, this does not require any special handling.
pub unsafe fn new(
/// This case was considered exotic enough to justify not making the function `unsafe`.
pub fn new(
mut spi: super::Spi<u8>,
#[cfg(feature = "vor1x")] opt_irq_cfg: Option<crate::InterruptConfig>,
) -> Self {
+3 -2
View File
@@ -125,7 +125,8 @@ impl<'uart, 'buf> TxFuture<'uart, 'buf> {
///
/// This function stores the raw pointer of the passed data slice. The user MUST ensure
/// that the slice outlives the data structure.
pub unsafe fn new(tx: &'uart mut Tx, data: &'buf [u8]) -> Self {
/// This case was considered exotic enough to justify not making the function `unsafe`.
pub fn new(tx: &'uart mut Tx, data: &'buf [u8]) -> Self {
if data.is_empty() {
// We can just return a dummy future which is immediately ready, no need to set up
// interrupts etc.
@@ -227,7 +228,7 @@ impl TxAsync {
/// This implementation is not side effect free, and a started future might have already
/// written part of the passed buffer.
pub fn write<'buf>(&mut self, buf: &'buf [u8]) -> TxFuture<'_, 'buf> {
unsafe { TxFuture::new(&mut self.0, buf) }
TxFuture::new(&mut self.0, buf)
}
/// Write an entire buffer into this writer.