Skip to content

Commit d6e6d4d

Browse files
committed
fix non-send future
1 parent de45575 commit d6e6d4d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/world/iter.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,11 @@ impl<'w, T: Data, const DIMS: usize, Io: IoHandle> Lazy<'w, T, DIMS, Io> {
268268
let chunk = self.world.load_chunk_buf(self.chunk).await;
269269
// Guard of a chunk.
270270
type Guard<'a, T> = RwLockReadGuard<'a, super::ChunkData<T>>;
271+
271272
// SAFETY: wrapping lifetime to 'w.
272273
let guard: Arc<Guard<'w, T>> = Arc::new(std::mem::transmute(chunk.data.read().await));
273-
let lock =
274-
&*(guard.get(&self.id).ok_or(crate::Error::ValueNotFound)? as *const RwLock<Option<T>>);
274+
let lock: &'w RwLock<Option<T>> =
275+
std::mem::transmute(guard.get(&self.id).ok_or(crate::Error::ValueNotFound)?);
275276

276277
if let Some(LazyInner::Ref(val)) = self.value.get_mut() {
277278
val.guard = None;

0 commit comments

Comments
 (0)