Last active
March 2, 2017 19:59
-
-
Save federicomenaquintero/83631495781c37a12966907f3eda106f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
enum MarkerType { | |
Start, | |
Middle, | |
End | |
} | |
type RenderMarkerFn = fn (MarkerType, | |
f64, // xpos | |
f64, // ypos | |
f64); // computed_angle | |
// This is fine | |
fn emit_marker_at_start_of_segment (some args ..., | |
emit_fn: RenderMarkerFn) { ... } | |
// I get an error when I call that like this | |
emit_marker_at_start_of_segment (builder, | |
|marker_type: MarkerType, x: f64, y: f64, computed_angle: f64| { ... }); | |
| __________________________^ starting here... | |
= note: expected type `fn(marker::MarkerType, f64, f64, f64)` | |
= note: found type `[[email protected]:683:36: 690:37 draw_ctx:_, linewidth:_]` | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment