Skip to content

Commit 401953c

Browse files
committed
Prefer implementing Send on the RoCursor
1 parent 92003c2 commit 401953c

File tree

4 files changed

+3
-18
lines changed

4 files changed

+3
-18
lines changed

heed/src/cursor.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,9 @@ impl<T> Drop for RoCursor<'_, T> {
243243
}
244244
}
245245

246+
// Only implement Send if the transaction is Send (WithoutTls)
247+
unsafe impl Send for RoCursor<'_, WithoutTls> {}
248+
246249
pub struct RwCursor<'txn> {
247250
cursor: RoCursor<'txn, WithoutTls>,
248251
}

heed/src/iterator/iter.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,6 @@ impl<KC, DC, IM> fmt::Debug for RoIter<'_, KC, DC, IM> {
210210
}
211211
}
212212

213-
// Only implement Send if the transaction is Send (WithoutTls)
214-
unsafe impl<KC, DC, IM> Send for RoIter<'_, WithoutTls, KC, DC, IM> {}
215-
216213
/// A read-write iterator structure.
217214
pub struct RwIter<'txn, KC, DC, IM = MoveThroughDuplicateValues> {
218215
cursor: RwCursor<'txn>,
@@ -559,9 +556,6 @@ impl<KC, DC, IM> fmt::Debug for RoRevIter<'_, KC, DC, IM> {
559556
}
560557
}
561558

562-
// Only implement Send if the transaction is Send (WithoutTls)
563-
unsafe impl<KC, DC, IM> Send for RoRevIter<'_, WithoutTls, KC, DC, IM> {}
564-
565559
/// A reverse read-write iterator structure.
566560
pub struct RwRevIter<'txn, KC, DC, IM = MoveThroughDuplicateValues> {
567561
cursor: RwCursor<'txn>,

heed/src/iterator/prefix.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,6 @@ impl<KC, DC, C, IM> fmt::Debug for RoPrefix<'_, KC, DC, C, IM> {
203203
}
204204
}
205205

206-
// Only implement Send if the transaction is Send (WithoutTls)
207-
unsafe impl<KC, DC, IM> Send for RoPrefix<'_, WithoutTls, KC, DC, IM> {}
208-
209206
/// A read-write prefix iterator structure.
210207
pub struct RwPrefix<'txn, KC, DC, C = DefaultComparator, IM = MoveThroughDuplicateValues> {
211208
cursor: RwCursor<'txn>,
@@ -596,9 +593,6 @@ impl<T, KC, DC, C, IM> fmt::Debug for RoRevPrefix<'_, T, KC, DC, C, IM> {
596593
}
597594
}
598595

599-
// Only implement Send if the transaction is Send (WithoutTls)
600-
unsafe impl<KC, DC, IM> Send for RoRevPrefix<'_, WithoutTls, KC, DC, IM> {}
601-
602596
/// A reverse read-write prefix iterator structure.
603597
pub struct RwRevPrefix<'txn, KC, DC, C = DefaultComparator, IM = MoveThroughDuplicateValues> {
604598
cursor: RwCursor<'txn>,

heed/src/iterator/range.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,6 @@ impl<KC, DC, C, IM> fmt::Debug for RoRange<'_, KC, DC, C, IM> {
199199
}
200200
}
201201

202-
// Only implement Send if the transaction is Send (WithoutTls)
203-
unsafe impl<KC, DC, C, IM> Send for RoRange<'_, WithoutTls, KC, DC, C, IM> {}
204-
205202
/// A read-write range iterator structure.
206203
pub struct RwRange<'txn, KC, DC, C = DefaultComparator, IM = MoveThroughDuplicateValues> {
207204
cursor: RwCursor<'txn>,
@@ -638,9 +635,6 @@ impl<KC, DC, C, IM> fmt::Debug for RoRevRange<'_, KC, DC, C, IM> {
638635
}
639636
}
640637

641-
// Only implement Send if the transaction is Send (WithoutTls)
642-
unsafe impl<KC, DC, C, IM> Send for RoRevRange<'_, WithoutTls, KC, DC, C, IM> {}
643-
644638
/// A reverse read-write range iterator structure.
645639
pub struct RwRevRange<'txn, KC, DC, C = DefaultComparator, IM = MoveThroughDuplicateValues> {
646640
cursor: RwCursor<'txn>,

0 commit comments

Comments
 (0)