Skip to content

Commit

Permalink
Fix unnecessary unsafe block warning
Browse files Browse the repository at this point in the history
  • Loading branch information
mttr committed Jan 8, 2015
1 parent 6364636 commit fc49e10
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions components/util/deque/mod.rs
Expand Up @@ -168,12 +168,10 @@ impl<T: Send> BufferPool<T> {
}

fn free(&self, buf: Box<Buffer<T>>) {
unsafe {
let mut pool = self.pool.lock();
match pool.iter().position(|v| v.size() > buf.size()) {
Some(i) => pool.insert(i, buf),
None => pool.push(buf),
}
let mut pool = self.pool.lock();
match pool.iter().position(|v| v.size() > buf.size()) {
Some(i) => pool.insert(i, buf),
None => pool.push(buf),
}
}
}
Expand Down

0 comments on commit fc49e10

Please sign in to comment.