|
|
|
|
|
by lambdaxymox
1236 days ago
|
|
Type inference occasionally bites one's hand when pushing data across an FFI boundary. In one instance I was writing some graphics code for a project and for some reason the colors in the rendering model were coming out all wrong on the screen (TL;DR it ended up looking like two of the color channels were missing from some texture maps) and it turns out that Rust inferred the type of the buffer as a vector of f64s instead of a vector of f32s. Putting the type in specifically fixed the problem promptly. Lesson learned: Sometimes type inference fails, and always annotate your types at FFI boundaries! |
|