mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 11:48:30 +00:00
18 lines
367 B
Rust
18 lines
367 B
Rust
![]() |
//@ check-pass
|
||
|
struct Foo<const D: usize> {
|
||
|
state: Option<[u8; D]>,
|
||
|
}
|
||
|
|
||
|
impl<const D: usize> Iterator for Foo<{D}> {
|
||
|
type Item = [u8; D];
|
||
|
fn next(&mut self) -> Option<Self::Item> {
|
||
|
if true {
|
||
|
return Some(self.state.unwrap().clone());
|
||
|
} else {
|
||
|
return Some(self.state.unwrap().clone());
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
fn main() {}
|