gir
gir copied to clipboard
`data` parameter for `gio::content_type_guess` should be an `Option`
According to the documentation, NULL
is a valid value for the data
parameter of g_content_type_guess
. However, the Rust bindings type it as &[u8]
, making it impossible to pass a null value.
Seems like gir
does not handle nullability annotations correctly in combination with arrays.
Yep, I managed to track it down to this line. Not sure if it's safe to remove completely or if it needs to be smarter, though.
It should almost work, but in addition you will also need to carry through the nullability in TransformationType::Length
so that inside src/codegen/function_body_chunk.rs
it does array.map(|array| array.len()).unwrap_or(0)
instead of array.len()
.
Want to give it a try?