Guess the language by the error
Jan. 1st, 2020 10:15 amhttps://stackoverflow.com/questions/59551596/expected-stditeriterator-but-stditeriterator-found
(Also, expression problem: https://stackoverflow.com/questions/59551656/peekable-of-an-iterator-in-struct)
It found what it expected, but no:
(Also, expression problem: https://stackoverflow.com/questions/59551656/peekable-of-an-iterator-in-struct)
It found what it expected, but no:
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
--> src/main.rs:52:27
|
52 | .map(|(x,y)| self.mx[y as usize][x as usize])))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the method body at 33:4...
--> src/main.rs:33:4
|
33 | / fn next(&mut self) -> Option<Self::Item> {
34 | | while self.xs.peek() == None && self.ys.peek() != None {
35 | | self.xs = &mut ((if self.dx < 0 { -3 * self.dx } else { 0 })..
36 | | (self.mx[0].len() as i32 - if self.dx > 0 { 4 * self.dx } else { 0 }))
... |
52 | | .map(|(x,y)| self.mx[y as usize][x as usize])))
53 | | }
| |____^
= note: ...so that the types are compatible:
expected &&mut Quads<'a>
found &&mut Quads<'a>
note: but, the lifetime must be valid for the lifetime 'a as defined on the impl at 30:6...
--> src/main.rs:30:6
|
30 | impl<'a> Iterator for Quads<'a> {
| ^^
= note: ...so that the types are compatible:
expected std::iter::Iterator
found std::iter::Iterator
no subject
Date: 2020-01-01 01:56 pm (UTC)no subject
Date: 2020-01-01 04:54 pm (UTC)