File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -68,19 +68,16 @@ class Slice {
68
68
// / Returns true if the slice has a length of 0.
69
69
constexpr inline bool is_empty () const & noexcept { return len_ == 0u ; }
70
70
71
- // / Returns a const reference the element at position `i` in the Slice.
71
+ // / Returns a reference to the element at position `i` in the Slice.
72
72
// /
73
73
// / # Panics
74
74
// / If the index `i` is beyond the end of the slice, the function will panic.
75
+ // / #[doc.overloads=slice.index.usize]
75
76
constexpr inline const T& operator [](usize i) const & noexcept {
76
77
check (i < len_);
77
78
return data_[i.primitive_value ];
78
79
}
79
80
80
- // / Returns a mutable reference the element at position `i` in the slice.
81
- // /
82
- // / # Panics
83
- // / If the index `i` is beyond the end of the slice, the function will panic.
84
81
constexpr T& operator [](usize i) & noexcept
85
82
requires (!std::is_const_v<T>)
86
83
{
@@ -143,6 +140,7 @@ class Slice {
143
140
// / # Panics
144
141
// / If the Range would otherwise contain an element that is out of bounds, the
145
142
// / function will panic.
143
+ // / #[doc.overloads=slice.index.range]
146
144
constexpr inline Slice<T> operator [](
147
145
const ::sus::ops::Range<usize> range) const noexcept {
148
146
const usize len = range.end >= range.start ? range.end - range.start : 0u ;
Original file line number Diff line number Diff line change @@ -371,21 +371,21 @@ class Vec {
371
371
return get_unchecked_mut (::sus::marker::unsafe_fn, i);
372
372
}
373
373
374
- // / #[doc.inherit=[n]sus::[n]containers ::[r]Slice::[f]sort]
374
+ // / #[doc.inherit=[n]sus::[n]ops ::[r]Slice::[f]sort]
375
375
void sort () { as_mut ().sort (); }
376
376
377
- // / #[doc.inherit=[n]sus::[n]containers ::[r]Slice::[f]sort_by]
377
+ // / #[doc.inherit=[n]sus::[n]ops ::[r]Slice::[f]sort_by]
378
378
template <class F , int &...,
379
379
class R = std::invoke_result_t <F, const T&, const T&>>
380
380
requires (::sus::ops::Ordering<R>)
381
381
void sort_by (F compare) {
382
382
as_mut ().sort_by (sus::move (compare));
383
383
}
384
384
385
- // / #[doc.inherit=[n]sus::[n]containers ::[r]Slice::[f]sort_unstable]
385
+ // / #[doc.inherit=[n]sus::[n]ops ::[r]Slice::[f]sort_unstable]
386
386
void sort_unstable () { as_mut ().sort (); }
387
387
388
- // / #[doc.inherit=[n]sus::[n]containers ::[r]Slice::[f]sort_unstable_by]
388
+ // / #[doc.inherit=[n]sus::[n]ops ::[r]Slice::[f]sort_unstable_by]
389
389
template <class F , int &...,
390
390
class R = std::invoke_result_t <F, const T&, const T&>>
391
391
requires (::sus::ops::Ordering<R>)
You can’t perform that action at this time.
0 commit comments