event_id: *mut std::os::raw::c_int,
event_type: *mut core::AppLayerEventType,
) -> std::os::raw::c_int {
- if event_name == std::ptr::null() {
+ if event_name.is_null() {
return -1;
}
pub unsafe extern "C" fn jb_set_string(
js: &mut JsonBuilder, key: *const c_char, val: *const c_char,
) -> bool {
- if val == std::ptr::null() {
+ if val.is_null() {
return false;
}
if let Ok(key) = CStr::from_ptr(key).to_str() {
pub unsafe extern "C" fn jb_set_string_from_bytes(
js: &mut JsonBuilder, key: *const c_char, bytes: *const u8, len: u32,
) -> bool {
- if bytes == std::ptr::null() || len == 0 {
+ if bytes.is_null() || len == 0 {
return false;
}
if let Ok(key) = CStr::from_ptr(key).to_str() {
#[no_mangle]
pub unsafe extern "C" fn jb_append_string(js: &mut JsonBuilder, val: *const c_char) -> bool {
- if val == std::ptr::null() {
+ if val.is_null() {
return false;
}
if let Ok(val) = CStr::from_ptr(val).to_str() {
pub unsafe extern "C" fn jb_append_string_from_bytes(
js: &mut JsonBuilder, bytes: *const u8, len: u32,
) -> bool {
- if bytes == std::ptr::null() || len == 0 {
+ if bytes.is_null() || len == 0 {
return false;
}
let val = std::slice::from_raw_parts(bytes, len as usize);
#![allow(clippy::for_loops_over_fallibles)]
#![allow(clippy::needless_lifetimes)]
#![allow(clippy::single_match)]
-#![allow(clippy::cmp_null)]
#![allow(clippy::upper_case_acronyms)]
#![allow(clippy::ptr_arg)]
#![allow(clippy::new_without_default)]
event_type: *mut AppLayerEventType)
-> std::os::raw::c_int
{
- if event_name == std::ptr::null() {
+ if event_name.is_null() {
return -1;
}
let c_event_name: &CStr = CStr::from_ptr(event_name);