Last active
December 17, 2016 20:31
-
-
Save craig-bishop/78df35fd42213cd15ddb51d842b2dd8d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn convert_to_complex<'a, I>(polygons: I) -> Vec<ComplexPolygon> | |
where I: Iterator<Item = &'a [(i32, i32)]>, | |
I: Clone | |
{ | |
... | |
} | |
... | |
static TEST_VERTS: &'static [&'static [(i32, i32)]] = | |
&[&[(0, 0), (40, 0), (40, 40), (0, 40)], | |
&[(10, 10), (30, 10), (30, 30), (10, 30)], | |
&[(5, 5), (5, 35), (35, 35), (35, 5)], | |
&[(15, 15), (15, 25), (25, 25), (25, 15)]]; | |
let result = convert_to_complex(TEST_VERTS.into_iter()); | |
... | |
error[E0271]: type mismatch resolving `<std::slice::Iter<'_, &[(i32, i32)]> as std::iter::Iterator>::Item == &[(i32, i32)]` | |
--> src/format.rs:100:22 | |
| | |
100 | let result = convert_to_complex(TEST_VERTS.into_iter()); | |
| ^^^^^^^^^^^^^^^^^^ expected reference, found slice | |
| | |
= note: expected type `&&[(i32, i32)]` | |
= note: found type `&[(i32, i32)]` | |
= note: required by `format::convert_to_complex` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment