embassy-sync: fix len calculation for zerocopy_channel

This commit is contained in:
Oliver Rockstedt 2024-10-06 17:39:47 +02:00
parent 383ad72b63
commit f3ed0c6026

View File

@ -290,7 +290,15 @@ impl State {
}
fn len(&self) -> usize {
self.len
if !self.full {
if self.back >= self.front {
self.back - self.front
} else {
self.len + self.back - self.front
}
} else {
self.len
}
}
fn is_full(&self) -> bool {