Skip to content

Commit bb8fa8b

Browse files
committed
* use expect for better code style
1 parent 4a8758b commit bb8fa8b

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

windows_build.rs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -253,22 +253,21 @@ impl DevelPack {
253253
.iter()
254254
.map(|lib| php_lib_path.join(lib))
255255
.find(|path| path.exists())
256-
.unwrap_or_else(||
257-
panic!(
258-
"{}",
259-
if is_debug {
260-
format!(
261-
r#"Error: No suitable PHP library found in '{}'.
256+
.expect(&format!(
257+
"{}",
258+
if is_debug {
259+
format!(
260+
r#"Error: No suitable PHP library found in '{}'.
262261
To build the application in DEBUG mode on Windows,
263262
you must have a PHP SDK built with the DEBUG option enabled
264263
and specify the PHP_LIB to the folder containing the lib files.
265264
For example: set PHP_LIB=C:\php-sdk\php-dev\vc16\x64\php-8.3.13-src\x64\Debug_TS."#,
266-
php_lib_path.display()
267-
)
268-
} else {
269-
format!("Error: No suitable PHP library found in '{}'.", php_lib_path.display())
270-
}
271-
))
265+
php_lib_path.display()
266+
)
267+
} else {
268+
format!("Error: No suitable PHP library found in '{}'.", php_lib_path.display())
269+
}
270+
))
272271
}
273272

274273
/// Returns a list of include paths to pass to the compiler.

0 commit comments

Comments
 (0)