@@ -361,7 +361,7 @@ fn make_cache_dir() -> Result<PathBuf, Box<dyn StdError>> {
361361fn download ( cache_dir : & Path , url : & str ) -> Result < PathBuf , Box < dyn StdError > > {
362362 fn proceed_with_download ( file_path : & Path ) -> bool {
363363 // File does not exist or is zero bytes
364- !file_path. exists ( ) || file_path. metadata ( ) . map_or ( false , |m| m. len ( ) < 1 )
364+ !file_path. exists ( ) || file_path. metadata ( ) . is_ok_and ( |m| m. len ( ) < 1 )
365365 }
366366 let filename = url. split ( '/' ) . last ( ) . unwrap ( ) ;
367367 let file_path = cache_dir. join ( filename) ;
@@ -544,7 +544,7 @@ fn compile_nginx(cache_dir: &Path) -> Result<(PathBuf, PathBuf), Box<dyn StdErro
544544 let build_info_path = nginx_src_dir. join ( "last-build-info" ) ;
545545 let current_build_info = build_info ( & nginx_configure_flags) ;
546546 let build_info_no_change = if build_info_path. exists ( ) {
547- read_to_string ( & build_info_path) . map_or ( false , |s| s == current_build_info)
547+ read_to_string ( & build_info_path) . is_ok_and ( |s| s == current_build_info)
548548 } else {
549549 false
550550 } ;
@@ -599,7 +599,7 @@ fn nginx_configure_flags(
599599 modules
600600 } ;
601601 let mut nginx_opts = vec ! [ format_source_path( "--prefix" , nginx_install_dir) ] ;
602- if env:: var ( "NGX_DEBUG" ) . map_or ( false , |s| s == "true" ) {
602+ if env:: var ( "NGX_DEBUG" ) . is_ok_and ( |s| s == "true" ) {
603603 println ! ( "Enabling --with-debug" ) ;
604604 nginx_opts. push ( "--with-debug" . to_string ( ) ) ;
605605 }
0 commit comments