The implementation for the TransferInPlace operation violates the aliasing rule by creating an immutable reference from a mutable one, but keeping both.
|
SpiOperation::TransferInPlace(buf) => { |
|
let tx = unsafe { |
|
let p = buf.as_ptr(); |
|
std::slice::from_raw_parts(p, buf.len()) |
|
}; |
|
transfers.push(SpidevTransfer::read_write(tx, buf)); |
|
} |
There needs to be a corresponding method for SpidevTransfer, e.g. read_write_in_place.
The implementation for the
TransferInPlaceoperation violates the aliasing rule by creating an immutable reference from a mutable one, but keeping both.linux-embedded-hal/src/spi.rs
Lines 216 to 222 in 1ffb268
There needs to be a corresponding method for
SpidevTransfer, e.g.read_write_in_place.