jnqnfe / pulse-binding-rust

FFI and bindings for using PulseAudio from the Rust programming language.
Apache License 2.0
67 stars 20 forks source link

Avoid double null check #41

Closed agraven closed 3 years ago

agraven commented 3 years ago

Since the pointers have already been confirmed to be non-null by the assert!() calls, there is no need to use .as_ref() and the raw pointers can be dereferenced directly. See the Null-unchecked version section of the standard library documentation for the pointer type's as_ref method.

jnqnfe commented 3 years ago

LGTM, thanks! :)