Use #[track_caller]
to make panic in Iterator::array_chunks
nicer
This commit is contained in:
parent
4db628a801
commit
3102b39daa
@ -24,6 +24,7 @@ impl<I, const N: usize> ArrayChunks<I, N>
|
||||
where
|
||||
I: Iterator,
|
||||
{
|
||||
#[track_caller]
|
||||
pub(in crate::iter) fn new(iter: I) -> Self {
|
||||
assert!(N != 0, "chunk size must be non-zero");
|
||||
Self { iter: iter.fuse(), remainder: None }
|
||||
|
@ -3350,6 +3350,7 @@ fn cycle(self) -> Cycle<Self>
|
||||
/// assert_eq!(x + y + z, 4);
|
||||
/// }
|
||||
/// ```
|
||||
#[track_caller]
|
||||
#[unstable(feature = "iter_array_chunks", reason = "recently added", issue = "none")]
|
||||
fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>
|
||||
where
|
||||
|
Loading…
Reference in New Issue
Block a user