Skip to content

Commit e658ce8

Browse files
committed
Small fix
1 parent 8514614 commit e658ce8

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

crates/macros/src/method.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -376,20 +376,20 @@ fn build_args(
376376
is_str = t.path.is_ident("str");
377377
}
378378
}
379-
}
380-
hack_tokens.append_all(if is_str {
381-
if is_option {
382-
quote! { let #param = #param.and_then(|__temp| Some(unsafe { ::core::mem::transmute::<&str, &'static str>(__temp) })); }
383-
} else {
384-
quote! { let #param = unsafe { ::core::mem::transmute::<&str, &'static str>(#param) }; }
385-
}
386-
} else {
387-
if is_option {
388-
quote! { let #param = #param.and_then(|__temp| Some(unsafe { ::ext_php_rs::zend::borrow_unchecked(__temp) })); }
379+
hack_tokens.append_all(if is_str {
380+
if is_option {
381+
quote! { let #param = #param.and_then(|__temp| Some(unsafe { ::core::mem::transmute::<&str, &'static str>(__temp) })); }
382+
} else {
383+
quote! { let #param = unsafe { ::core::mem::transmute::<&str, &'static str>(#param) }; }
384+
}
389385
} else {
390-
quote! { let #param = unsafe { ::ext_php_rs::zend::borrow_unchecked(#param) }; }
391-
}
392-
});
386+
if is_option {
387+
quote! { let #param = #param.and_then(|__temp| Some(unsafe { ::ext_php_rs::zend::borrow_unchecked(__temp) })); }
388+
} else {
389+
quote! { let #param = unsafe { ::ext_php_rs::zend::borrow_unchecked(#param) }; }
390+
}
391+
});
392+
}
393393

394394
let default = defaults.get(&name);
395395
let mut ty = ty.ty.clone();

src/zend/fibers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use lazy_static::lazy_static;
1515
use tokio::runtime::Runtime;
1616
use std::os::fd::AsRawFd;
1717

18-
use super::{borrow_unchecked, printf};
18+
use super::{borrow_unchecked};
1919

2020
lazy_static! {
2121
pub static ref RUNTIME: Runtime = Runtime::new().expect("Could not allocate runtime");

0 commit comments

Comments
 (0)