Skip to content

Commit dcfa6e6

Browse files
committed
Fix is_done() to use as_mut()
1 parent a03e521 commit dcfa6e6

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

CHANGELOG.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
## Unreleased
44

5-
(no changes)
5+
### Fixes
6+
7+
- Fix mistake in SPIS `Transfer` `is_done` to borrow `inner`.
68

79
## [0.12.2]
810

@@ -126,9 +128,9 @@
126128
- Also return owned `Pins` from `Usart::free()` ([#261]).
127129

128130
¹ _A trait can be sealed by making a private trait a supertrait. That way, no
129-
downstream crates can implement it (since they can't name the supertrait).
130-
This is just to make sure the trait isn't implemented by types that shouldn't
131-
implement it._
131+
downstream crates can implement it (since they can't name the supertrait).
132+
This is just to make sure the trait isn't implemented by types that shouldn't
133+
implement it._
132134

133135
### Internal Improvements
134136

nrf-hal-common/src/spis.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ impl<T: Instance, B> Transfer<T, B> {
439439
pub fn is_done(&mut self) -> bool {
440440
let inner = self
441441
.inner
442-
.take()
442+
.as_mut()
443443
.unwrap_or_else(|| unsafe { core::hint::unreachable_unchecked() });
444444
inner.spis.is_done()
445445
}

0 commit comments

Comments
 (0)