You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The signature of gio::content_type_guess has the type of data as &[u8]. The same documentation, and also the gio documentation mention that data can be None. So a better signature would set data to Option<&[u8]> or similar. Note that the current signature can lead to wrong results if one wants the content type to be guessed only based on the filetype, this is not possible based on the current signature.
This change would be breaking.
The text was updated successfully, but these errors were encountered:
It looks like currently all array-like nullable parameters are not optional. Passing &[] might or might not do what you want, but this should probably be fixed and be made more explicit. It's also not guaranteed that empty / NULL give the same behaviour.
Pretty sure None and &[] are not the same for this function, passing &[] is interpreted as "empty file" and leading to application/x-empty (at least in one case I had, it worked for one other case. Not sure what the exact rules are).
Bug description
The signature of
gio::content_type_guess
has the type ofdata
as&[u8]
. The same documentation, and also the gio documentation mention thatdata
can beNone
. So a better signature would setdata
toOption<&[u8]>
or similar. Note that the current signature can lead to wrong results if one wants the content type to be guessed only based on the filetype, this is not possible based on the current signature.This change would be breaking.
The text was updated successfully, but these errors were encountered: