diff --git a/src/embed/mod.rs b/src/embed/mod.rs index 0ad64a6..d8f914f 100644 --- a/src/embed/mod.rs +++ b/src/embed/mod.rs @@ -1,8 +1,9 @@ //! Provides implementations for running php code from rust. //! It only works on linux for now and you should have `php-embed` installed //! -//! This crate was only test with PHP 8.2 please report any issue with other version -//! You should only use this crate for test purpose, it's not production ready +//! This crate was only test with PHP 8.2 please report any issue with other +//! version You should only use this crate for test purpose, it's not production +//! ready mod ffi; @@ -43,13 +44,14 @@ static RUN_FN_LOCK: RwLock<()> = const_rwlock(()); impl Embed { /// Run a php script from a file /// - /// This function will only work correctly when used inside the `Embed::run` function - /// otherwise behavior is unexpected + /// This function will only work correctly when used inside the `Embed::run` + /// function otherwise behavior is unexpected /// /// # Returns /// /// * `Ok(())` - The script was executed successfully - /// * `Err(EmbedError)` - An error occured during the execution of the script + /// * `Err(EmbedError)` - An error occured during the execution of the + /// script /// /// # Example /// @@ -97,10 +99,10 @@ impl Embed { /// Start and run embed sapi engine /// - /// This function will allow to run php code from rust, the same PHP context is keep between calls - /// inside the function passed to this method. - /// Which means subsequent calls to `Embed::eval` or `Embed::run_script` will be able to access - /// variables defined in previous calls + /// This function will allow to run php code from rust, the same PHP context + /// is keep between calls inside the function passed to this method. + /// Which means subsequent calls to `Embed::eval` or `Embed::run_script` + /// will be able to access variables defined in previous calls /// /// # Returns /// @@ -127,7 +129,8 @@ impl Embed { // @TODO handle php thread safe // // This is to prevent multiple threads from running php at the same time - // At some point we should detect if php is compiled with thread safety and avoid doing that in this case + // At some point we should detect if php is compiled with thread safety and + // avoid doing that in this case let _guard = RUN_FN_LOCK.write(); let panic = unsafe { @@ -155,7 +158,8 @@ impl Embed { /// Evaluate a php code /// - /// This function will only work correctly when used inside the `Embed::run` function + /// This function will only work correctly when used inside the `Embed::run` + /// function /// /// # Returns /// diff --git a/src/types/class_object.rs b/src/types/class_object.rs index 753933d..9b63b50 100644 --- a/src/types/class_object.rs +++ b/src/types/class_object.rs @@ -5,7 +5,8 @@ use std::{ fmt::Debug, mem, ops::{Deref, DerefMut}, - ptr::{self, NonNull}, os::raw::c_char, + os::raw::c_char, + ptr::{self, NonNull}, }; use crate::{ diff --git a/src/zend/ini_entry_def.rs b/src/zend/ini_entry_def.rs index 8817300..d9c8f64 100644 --- a/src/zend/ini_entry_def.rs +++ b/src/zend/ini_entry_def.rs @@ -7,8 +7,9 @@ use crate::{ffi::zend_ini_entry_def, ffi::zend_register_ini_entries, flags::IniE /// A Zend ini entry definition. /// -/// To register ini definitions for extensions, the IniEntryDef builder should be used. Ini -/// entries should be registered in your module's startup_function via `IniEntryDef::register(Vec)`. +/// To register ini definitions for extensions, the IniEntryDef builder should +/// be used. Ini entries should be registered in your module's startup_function +/// via `IniEntryDef::register(Vec)`. pub type IniEntryDef = zend_ini_entry_def; impl IniEntryDef { diff --git a/src/zend/try_catch.rs b/src/zend/try_catch.rs index f74b427..37cd896 100644 --- a/src/zend/try_catch.rs +++ b/src/zend/try_catch.rs @@ -18,7 +18,8 @@ pub(crate) unsafe extern "C" fn panic_wrapper R + RefUnwindSafe /// PHP propose a try catch mechanism in C using setjmp and longjmp (bailout) /// It store the arg of setjmp into the bailout field of the global executor -/// If a bailout is triggered, the executor will jump to the setjmp and restore the previous setjmp +/// If a bailout is triggered, the executor will jump to the setjmp and restore +/// the previous setjmp /// /// try_catch allow to use this mechanism /// @@ -60,10 +61,11 @@ pub fn try_catch R + RefUnwindSafe>(func: F) -> Result ! { ext_php_rs_zend_bailout(); }