nagisa / rust_libloading

Bindings around the platform's dynamic library loading primitives with greatly improved memory safety.
https://docs.rs/libloading
ISC License
1.24k stars 102 forks source link

refactor: library_filename use string rather than os_string #160

Closed tisonkun closed 1 week ago

tisonkun commented 1 week ago

@nagisa I'm not quite sure why we use os_string here. Seems we can always construct os_string from string and by making this change the function is more easy to use in the caller side.

nagisa commented 1 week ago

The name here is not necessarily a string, even if the prefix and suffix are strings. On unix systems the filename is not required to be a valid UTF-8 and on Windows systems filenames are some weird 16-bit thing.

I cannot land this for those reasons.

tisonkun commented 1 week ago

@nagisa Thanks for your information!