Skip to content

Commit 02ec2fc

Browse files
committed
Use markdown header for Safety comments
1 parent 499fc53 commit 02ec2fc

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

subspace/iter/iterator_defn.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ bool IteratorImpl<Iter, Item>::all(::sus::fn::FnMut<bool(Item)> f) noexcept {
244244
while (true) {
245245
Option<Item> item = this->next();
246246
if (item.is_none()) return true;
247-
// Safety: `item` was checked to hold Some already.
247+
// SAFETY: `item` was checked to hold Some already.
248248
if (!f(item.take().unwrap_unchecked(::sus::marker::unsafe_fn)))
249249
return false;
250250
}
@@ -256,7 +256,7 @@ bool IteratorImpl<Iter, Item>::any(::sus::fn::FnMut<bool(Item)> f) noexcept {
256256
while (true) {
257257
Option<Item> item = this->next();
258258
if (item.is_none()) return false;
259-
// Safety: `item` was checked to hold Some already.
259+
// SAFETY: `item` was checked to hold Some already.
260260
if (f(item.take().unwrap_unchecked(::sus::marker::unsafe_fn))) return true;
261261
}
262262
}

subspace/mem/take.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ inline constexpr T take(T& t) noexcept {
4545

4646
/// Moves from `t` and destroys the object at `t`. Returns the old value of `t`.
4747
///
48-
/// SAFETY: This does *not* re-construct the object pointed to by `t`. It must
49-
/// not be used (or destructed again) afterward.
48+
/// # Safety
49+
/// This does *not* re-construct the object pointed to by `t`. It must not be
50+
/// used (or destructed again) afterward.
5051
template <class T>
5152
requires(::sus::mem::Move<T>)
5253
inline constexpr T take_and_destruct(::sus::marker::UnsafeFnMarker,
@@ -63,8 +64,9 @@ inline constexpr T take_and_destruct(::sus::marker::UnsafeFnMarker,
6364
/// Copies from `t` and destroys the object at `t`. Returns the old value of
6465
/// `t`.
6566
///
66-
/// SAFETY: This does *not* re-construct the object pointed to by `t`. It must
67-
/// not be used (or destructed again) afterward.
67+
/// Safety
68+
/// This does *not* re-construct the object pointed to by `t`. It must not be
69+
/// used (or destructed again) afterward.
6870
template <class T>
6971
requires(::sus::mem::Copy<T>)
7072
inline constexpr T take_copy_and_destruct(::sus::marker::UnsafeFnMarker,

0 commit comments

Comments
 (0)