Running clippy against master produces a couple of lint failures:
warning: Comparing with null is better expressed by the .is_null() method
--> src/wrapped.rs:121:12
|
121 | if env != ptr::null(){
| ^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(clippy::cmp_null)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_null
error: this public function dereferences a raw pointer but is not marked `unsafe`
--> src/wrapped.rs:206:17
|
206 | prompt
| ^^^^^^
|
= note: `#[deny(clippy::not_unsafe_ptr_arg_deref)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#not_unsafe_ptr_arg_deref
The second could theoretically lead to undefined behavior if the user passes an expired pointer. Either marking the function as unsafe or changing the type of the prompt argument to Option<&CStr> should fix the issue.
Running
clippy
againstmaster
produces a couple of lint failures:The second could theoretically lead to undefined behavior if the user passes an expired pointer. Either marking the function as
unsafe
or changing the type of theprompt
argument toOption<&CStr>
should fix the issue.