@@ -16,13 +16,13 @@ use std::path::PathBuf;
1616use std:: process:: Command ;
1717
1818// Windows specific library file names
19- static WIN_CUDA_LIB : & ' static str = "afcuda" ;
20- static WIN_OCL_LIB : & ' static str = "afopencl" ;
21- static WIN_UNI_LIB : & ' static str = "af" ;
19+ static WIN_CUDA_LIB : & str = "afcuda" ;
20+ static WIN_OCL_LIB : & str = "afopencl" ;
21+ static WIN_UNI_LIB : & str = "af" ;
2222// Linux & OSX specific library file names
23- static UNIX_CUDA_LIB : & ' static str = "libafcuda" ;
24- static UNIX_OCL_LIB : & ' static str = "libafopencl" ;
25- static UNIX_UNI_LIB : & ' static str = "libaf" ;
23+ static UNIX_CUDA_LIB : & str = "libafcuda" ;
24+ static UNIX_OCL_LIB : & str = "libafopencl" ;
25+ static UNIX_UNI_LIB : & str = "libaf" ;
2626
2727#[ allow( dead_code) ]
2828#[ derive( Deserialize , Debug ) ]
@@ -187,14 +187,14 @@ fn prep_cmake_options(conf: &Config) -> Vec<String> {
187187 } ;
188188 match conf. with_opencl_blas_lib . as_ref ( ) {
189189 "clblast" => {
190- options. push ( format ! ( "-DAF_OPENCL_BLAS_LIBRARY:STRING=CLBlast" ) ) ;
190+ options. push ( "-DAF_OPENCL_BLAS_LIBRARY:STRING=CLBlast" . to_string ( ) ) ;
191191 }
192192 "clblas" => {
193- options. push ( format ! ( "-DAF_OPENCL_BLAS_LIBRARY:STRING=clBLAS" ) ) ;
193+ options. push ( "-DAF_OPENCL_BLAS_LIBRARY:STRING=clBLAS" . to_string ( ) ) ;
194194 }
195195 _ => fail ( "Invalid value for with_opencl_blas_lib option" ) ,
196196 } ;
197- return options;
197+ options
198198}
199199
200200#[ cfg( windows) ]
@@ -269,7 +269,7 @@ fn run_cmake_command(conf: &Config, build_dir: &std::path::PathBuf) {
269269 run (
270270 make_cmd
271271 . arg ( format ! ( "-j{}" , conf. build_threads) )
272- . arg ( format ! ( "install" ) ) ,
272+ . arg ( "install" . to_string ( ) ) ,
273273 "make" ,
274274 ) ;
275275}
@@ -279,7 +279,7 @@ fn backend_exists(name: &str) -> bool {
279279 let osx_backend = name. to_string ( ) + ".dylib" ;
280280 let linux_backend = name. to_string ( ) + ".so" ;
281281
282- return file_exists ( & win_backend) || file_exists ( & osx_backend) || file_exists ( & linux_backend) ;
282+ file_exists ( & win_backend) || file_exists ( & osx_backend) || file_exists ( & linux_backend)
283283}
284284
285285fn blob_backends ( conf : & Config , build_dir : & std:: path:: PathBuf ) -> ( Vec < String > , Vec < String > ) {
@@ -402,19 +402,17 @@ fn blob_backends(conf: &Config, build_dir: &std::path::PathBuf) -> (Vec<String>,
402402 }
403403 }
404404
405- if conf. with_graphics == "ON" {
406- if !conf. use_lib {
407- backend_dirs. push (
408- build_dir
409- . join ( "third_party" )
410- . join ( "forge" )
411- . join ( "lib" )
412- . to_str ( )
413- . to_owned ( )
414- . unwrap ( )
415- . to_string ( ) ,
416- ) ;
417- }
405+ if conf. with_graphics == "ON" && !conf. use_lib {
406+ backend_dirs. push (
407+ build_dir
408+ . join ( "third_party" )
409+ . join ( "forge" )
410+ . join ( "lib" )
411+ . to_str ( )
412+ . to_owned ( )
413+ . unwrap ( )
414+ . to_string ( ) ,
415+ ) ;
418416 }
419417 }
420418
@@ -425,7 +423,7 @@ fn blob_backends(conf: &Config, build_dir: &std::path::PathBuf) -> (Vec<String>,
425423 }
426424 }
427425
428- return ( backends, backend_dirs) ;
426+ ( backends, backend_dirs)
429427}
430428
431429fn main ( ) {
0 commit comments