mirror of
https://github.com/danog/ext-php-rs.git
synced 2024-11-26 20:15:22 +01:00
Small fix
This commit is contained in:
parent
8514614521
commit
e658ce890f
@ -376,20 +376,20 @@ fn build_args(
|
||||
is_str = t.path.is_ident("str");
|
||||
}
|
||||
}
|
||||
hack_tokens.append_all(if is_str {
|
||||
if is_option {
|
||||
quote! { let #param = #param.and_then(|__temp| Some(unsafe { ::core::mem::transmute::<&str, &'static str>(__temp) })); }
|
||||
} else {
|
||||
quote! { let #param = unsafe { ::core::mem::transmute::<&str, &'static str>(#param) }; }
|
||||
}
|
||||
} else {
|
||||
if is_option {
|
||||
quote! { let #param = #param.and_then(|__temp| Some(unsafe { ::ext_php_rs::zend::borrow_unchecked(__temp) })); }
|
||||
} else {
|
||||
quote! { let #param = unsafe { ::ext_php_rs::zend::borrow_unchecked(#param) }; }
|
||||
}
|
||||
});
|
||||
}
|
||||
hack_tokens.append_all(if is_str {
|
||||
if is_option {
|
||||
quote! { let #param = #param.and_then(|__temp| Some(unsafe { ::core::mem::transmute::<&str, &'static str>(__temp) })); }
|
||||
} else {
|
||||
quote! { let #param = unsafe { ::core::mem::transmute::<&str, &'static str>(#param) }; }
|
||||
}
|
||||
} else {
|
||||
if is_option {
|
||||
quote! { let #param = #param.and_then(|__temp| Some(unsafe { ::ext_php_rs::zend::borrow_unchecked(__temp) })); }
|
||||
} else {
|
||||
quote! { let #param = unsafe { ::ext_php_rs::zend::borrow_unchecked(#param) }; }
|
||||
}
|
||||
});
|
||||
|
||||
let default = defaults.get(&name);
|
||||
let mut ty = ty.ty.clone();
|
||||
|
@ -15,7 +15,7 @@ use lazy_static::lazy_static;
|
||||
use tokio::runtime::Runtime;
|
||||
use std::os::fd::AsRawFd;
|
||||
|
||||
use super::{borrow_unchecked, printf};
|
||||
use super::{borrow_unchecked};
|
||||
|
||||
lazy_static! {
|
||||
pub static ref RUNTIME: Runtime = Runtime::new().expect("Could not allocate runtime");
|
||||
|
Loading…
Reference in New Issue
Block a user