aboutsummaryrefslogtreecommitdiffstats
path: root/components/util/persistent_list.rs
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2015-09-09 00:05:17 -0600
committerbors-servo <metajack+bors@gmail.com>2015-09-09 00:05:17 -0600
commitbe9a9ffda10fa2c50b13f79dabd49255f29f12f6 (patch)
tree9622df47c5446e93def3e0012de97e31bc188778 /components/util/persistent_list.rs
parent83972196600f04e817ddb53fda18142778905307 (diff)
parent94dec69247504a976cfa61495da759286160abec (diff)
downloadservo-be9a9ffda10fa2c50b13f79dabd49255f29f12f6.tar.gz
servo-be9a9ffda10fa2c50b13f79dabd49255f29f12f6.zip
Auto merge of #7523 - eefriedman:unnecessary-unsafe, r=SimonSapin
Fix up some unnecessary uses of `unsafe`. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7523) <!-- Reviewable:end -->
Diffstat (limited to 'components/util/persistent_list.rs')
-rw-r--r--components/util/persistent_list.rs11
1 files changed, 1 insertions, 10 deletions
diff --git a/components/util/persistent_list.rs b/components/util/persistent_list.rs
index 55d2b6cd2fd..9043fe76e54 100644
--- a/components/util/persistent_list.rs
+++ b/components/util/persistent_list.rs
@@ -4,7 +4,6 @@
//! A persistent, thread-safe singly-linked list.
-use std::mem;
use std::sync::Arc;
pub struct PersistentList<T> {
@@ -81,15 +80,7 @@ impl<'a, T> Iterator for PersistentListIterator<'a, T> where T: Send + Sync + 's
fn next(&mut self) -> Option<&'a T> {
let entry = match self.entry {
None => return None,
- Some(entry) => {
- // This `transmute` is necessary to ensure that the lifetimes of the next entry and
- // this entry match up; the compiler doesn't know this, but we do because of the
- // reference counting behavior of `Arc`.
- unsafe {
- mem::transmute::<&'a PersistentListEntry<T>,
- &'static PersistentListEntry<T>>(entry)
- }
- }
+ Some(entry) => entry,
};
let value = &entry.value;
self.entry = match entry.next {