mirror of
https://github.com/icewind1991/ivory.git
synced 2026-06-03 18:54:07 +02:00
clippy hints
This commit is contained in:
parent
71b8b56454
commit
1ec6938bfa
4 changed files with 5 additions and 2 deletions
|
|
@ -78,7 +78,7 @@ fn export_fn(item: ItemFn) -> TokenStream {
|
|||
|
||||
quote! {
|
||||
#[no_mangle]
|
||||
pub extern "C" fn #name(data: *const ::ivory::zend::ExecuteData, retval: *mut ::ivory::zend::ZVal) {
|
||||
pub unsafe extern "C" fn #name(data: *const ::ivory::zend::ExecuteData, retval: *mut ::ivory::zend::ZVal) {
|
||||
let data: &::ivory::zend::ExecuteData = unsafe { data.as_ref() }.unwrap();
|
||||
// the less than case is handled during argument casting
|
||||
// this is needed for optional arguments
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ macro_rules! impl_from_array_key {
|
|||
($type:ty, $variant:ident, $type2:ty) => {
|
||||
impl From<$type> for ArrayKey {
|
||||
fn from(input: $type) -> Self {
|
||||
#[allow(clippy::cast_lossless)]
|
||||
ArrayKey::$variant(input as $type2)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,9 +45,10 @@ pub struct ModuleInternal {
|
|||
|
||||
impl ModuleInternal {
|
||||
pub fn new(name: *const c_char, version: *const c_char) -> ModuleInternal {
|
||||
#[allow(clippy::inconsistent_digit_grouping)]
|
||||
ModuleInternal {
|
||||
size: mem::size_of::<ModuleInternal>() as u16,
|
||||
zend_api: 20180731,
|
||||
zend_api: 2018_07_31,
|
||||
zend_debug: 0,
|
||||
zts: 0,
|
||||
ini_entry: std::ptr::null(),
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ pub struct ZendStringHeader {
|
|||
len: usize,
|
||||
}
|
||||
|
||||
#[allow(clippy::cast_ptr_alignment)] // alignment of pointer casts is guaranteed by the layout
|
||||
fn string_into_zend_str(string: String) -> *mut zend_string {
|
||||
let len = string.len();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue