Skip to content
Snippets Groups Projects
Commit 4017741f authored by Stefan Lankes's avatar Stefan Lankes
Browse files

remove clippy warnings

parent 20c9d8e8
No related branches found
No related tags found
No related merge requests found
...@@ -335,7 +335,7 @@ impl PriorityTaskQueue { ...@@ -335,7 +335,7 @@ impl PriorityTaskQueue {
/// Change priority of specifc task /// Change priority of specifc task
pub fn set_priority(&mut self, handle: TaskHandle, prio: Priority) -> Result<(), ()> { pub fn set_priority(&mut self, handle: TaskHandle, prio: Priority) -> Result<(), ()> {
let i = handle.get_priority().into() as usize; let i = handle.get_priority().into() as usize;
let pos = self.queues[i].head.as_mut().ok_or(())?; let mut pos = self.queues[i].head.as_mut().ok_or(())?;
loop { loop {
if handle.id == pos.borrow().id { if handle.id == pos.borrow().id {
...@@ -354,8 +354,6 @@ impl PriorityTaskQueue { ...@@ -354,8 +354,6 @@ impl PriorityTaskQueue {
next.borrow_mut().prev = new; next.borrow_mut().prev = new;
} }
drop(pos);
if borrow.prev.as_mut().is_none() { if borrow.prev.as_mut().is_none() {
// Ok, the task is head of the list // Ok, the task is head of the list
self.queues[i].head = borrow.next.as_ref().cloned(); self.queues[i].head = borrow.next.as_ref().cloned();
...@@ -376,8 +374,8 @@ impl PriorityTaskQueue { ...@@ -376,8 +374,8 @@ impl PriorityTaskQueue {
return Ok(()); return Ok(());
} }
let mut pos_borrowed = pos.borrow_mut(); let ptr = pos.as_ptr();
let pos = pos_borrowed.next.as_mut().ok_or(())?; pos = unsafe { (*ptr).next.as_mut().ok_or(())? };
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment