Fix inverted boolean condition

This commit is contained in:
Til Blechschmidt 2022-03-08 16:29:42 +01:00
parent 993428e2d4
commit 7540b44050
No known key found for this signature in database
GPG key ID: 2F4E54D35C8390CB

View file

@ -23,7 +23,7 @@ pub(crate) fn slice_in_ram<T>(slice: *const [T]) -> bool {
#[cfg(not(feature = "nrf51"))]
pub(crate) fn slice_in_ram_or<T, E>(slice: *const [T], err: E) -> Result<(), E> {
let (_, len) = slice_ptr_parts(slice);
if len > 0 && slice_in_ram(slice) {
if len == 0 || slice_in_ram(slice) {
Ok(())
} else {
Err(err)