Skip to content

Commit f85c123

Browse files
authored
Simplify memory swap (#847)
@rolyatmax caught this, it may have been useful at some point but it no longer is since we aren't doing anything with the result. <!-- ELLIPSIS_HIDDEN --> ---- > [!IMPORTANT] > Replace `std::mem::swap` with direct assignment in `set_sender()` in `key_manager.rs`. > > - **Refactor**: > - Replace `std::mem::swap` with direct assignment in `set_sender()` in `key_manager.rs` for `handle` update. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=jamsocket%2Fplane&utm_source=github&utm_medium=referral)<sup> for 7ff7225. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
1 parent 7d16a75 commit f85c123

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plane/src/drone/key_manager.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@ impl KeyManager {
124124
self.sender.replace(sender);
125125

126126
for (backend, (acquired_key, handle)) in self.handles.iter_mut() {
127-
let mut new_handle = GuardHandle::new(renew_key_loop(
127+
let new_handle = GuardHandle::new(renew_key_loop(
128128
acquired_key.clone(),
129129
backend.clone(),
130130
self.sender.clone(),
131131
self.executor.clone(),
132132
));
133133

134-
std::mem::swap(handle, &mut new_handle);
134+
*handle = new_handle;
135135
}
136136
}
137137

0 commit comments

Comments
 (0)