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 document of Library::get says that the symbol “may not contain any null bytes, with the exception of the last byte”, which is exactly what CStr is. So I think it is reasonable to provide a get method that accepts &CStr. Changing the current Library::get method is a breaking change, so a new method might need to to be added.
The text was updated successfully, but these errors were encountered:
The bytestring passed in to get is allowed to not contain the trailing null too, but if one is present it must be the last byte. CStr meanwhile requires that the last byte is null. The only reason for the bytestring in this API is because at the time literals (the predominant use-case) could only produce &str or &[u8]. Nowadays there are c literals, so it might actually make sense to change to &CStr.
Breaking changes are not a huge deal, the library is still pre 1.0.
The document of
Library::get
says that the symbol “may not contain any null bytes, with the exception of the last byte”, which is exactly whatCStr
is. So I think it is reasonable to provide aget
method that accepts&CStr
. Changing the currentLibrary::get
method is a breaking change, so a new method might need to to be added.The text was updated successfully, but these errors were encountered: