gtk-rs / gtk-rs-core

Rust bindings for GNOME libraries
https://gtk-rs.org/gtk-rs-core
MIT License
284 stars 113 forks source link

[BUG] `into_glib_ptr` does not need to be `unsafe fn` #1483

Open kawadakk opened 2 months ago

kawadakk commented 2 months ago

Bug description

Similarly to Box::into_raw, IntoGlibPtr::into_glib_ptr merely converts self into a raw pointer, which is inert by itself. There don't seem to be any safety invariants (preconditions) the caller needs to uphold.

Backtrace

N/A

sdroege commented 2 months ago

That's true, same for to_glib_none() etc.

Do you want to provide a PR for that?