@@ -165,7 +165,7 @@ fn get_boringssl_platform_output_path(config: &Config) -> String {
165165 let deb_info = match debug_env_var. to_str ( ) {
166166 Some ( "false" ) => false ,
167167 Some ( "true" ) => true ,
168- _ => panic ! ( "Unknown DEBUG={:?} env var." , debug_env_var ) ,
168+ _ => panic ! ( "Unknown DEBUG={debug_env_var :?} env var." ) ,
169169 } ;
170170
171171 let opt_env_var = config
@@ -184,12 +184,12 @@ fn get_boringssl_platform_output_path(config: &Config) -> String {
184184 }
185185 }
186186 Some ( "s" | "z" ) => "MinSizeRel" ,
187- _ => panic ! ( "Unknown OPT_LEVEL={:?} env var." , opt_env_var ) ,
187+ _ => panic ! ( "Unknown OPT_LEVEL={opt_env_var :?} env var." ) ,
188188 } ;
189189
190190 subdir. to_string ( )
191191 } else {
192- "" . to_string ( )
192+ String :: new ( )
193193 }
194194}
195195
@@ -242,7 +242,7 @@ fn get_boringssl_cmake_config(config: &Config) -> cmake::Config {
242242 }
243243 let toolchain_file = android_ndk_home. join ( "build/cmake/android.toolchain.cmake" ) ;
244244 let toolchain_file = toolchain_file. to_str ( ) . unwrap ( ) ;
245- eprintln ! ( "android toolchain={}" , toolchain_file ) ;
245+ eprintln ! ( "android toolchain={toolchain_file}" ) ;
246246 boringssl_cmake. define ( "CMAKE_TOOLCHAIN_FILE" , toolchain_file) ;
247247
248248 // 21 is the minimum level tested. You can give higher value.
@@ -273,7 +273,7 @@ fn get_boringssl_cmake_config(config: &Config) -> cmake::Config {
273273 ""
274274 } ;
275275
276- let cflag = format ! ( "{} {}" , bitcode_cflag , target_cflag ) ;
276+ let cflag = format ! ( "{bitcode_cflag } {target_cflag}" ) ;
277277 boringssl_cmake. define ( "CMAKE_ASM_FLAGS" , & cflag) ;
278278 boringssl_cmake. cflag ( & cflag) ;
279279 }
@@ -339,7 +339,7 @@ fn verify_fips_clang_version() -> (&'static str, &'static str) {
339339 let output = match Command :: new ( tool) . arg ( "--version" ) . output ( ) {
340340 Ok ( o) => o,
341341 Err ( e) => {
342- eprintln ! ( "warning: missing {}, trying other compilers: {}" , tool , e ) ;
342+ eprintln ! ( "warning: missing {tool }, trying other compilers: {e}" ) ;
343343 // NOTE: hard-codes that the loop below checks the version
344344 return None ;
345345 }
@@ -369,13 +369,11 @@ fn verify_fips_clang_version() -> (&'static str, &'static str) {
369369 return ( cc, cxx) ;
370370 } else if cc == "cc" {
371371 panic ! (
372- "unsupported clang version \" {}\" : FIPS requires clang {}" ,
373- cc_version, REQUIRED_CLANG_VERSION
372+ "unsupported clang version \" {cc_version}\" : FIPS requires clang {REQUIRED_CLANG_VERSION}"
374373 ) ;
375374 } else if !cc_version. is_empty ( ) {
376375 eprintln ! (
377- "warning: FIPS requires clang version {}, skipping incompatible version \" {}\" " ,
378- REQUIRED_CLANG_VERSION , cc_version
376+ "warning: FIPS requires clang version {REQUIRED_CLANG_VERSION}, skipping incompatible version \" {cc_version}\" "
379377 ) ;
380378 }
381379 }
@@ -425,7 +423,7 @@ fn get_extra_clang_args_for_bindgen(config: &Config) -> Vec<String> {
425423 . unwrap ( ) ;
426424 if !output. status . success ( ) {
427425 if let Some ( exit_code) = output. status . code ( ) {
428- eprintln ! ( "xcrun failed: exit code {}" , exit_code ) ;
426+ eprintln ! ( "xcrun failed: exit code {exit_code}" ) ;
429427 } else {
430428 eprintln ! ( "xcrun failed: killed" ) ;
431429 }
@@ -452,8 +450,7 @@ fn get_extra_clang_args_for_bindgen(config: &Config) -> Vec<String> {
452450 Ok ( toolchain) => toolchain,
453451 Err ( e) => {
454452 eprintln ! (
455- "warning: failed to find prebuilt Android NDK toolchain for bindgen: {}" ,
456- e
453+ "warning: failed to find prebuilt Android NDK toolchain for bindgen: {e}"
457454 ) ;
458455 // Uh... let's try anyway, I guess?
459456 return params;
@@ -537,8 +534,8 @@ fn run_command(command: &mut Command) -> io::Result<Output> {
537534
538535 if !out. status . success ( ) {
539536 let err = match out. status . code ( ) {
540- Some ( code) => format ! ( "{:?} exited with status: {}" , command , code ) ,
541- None => format ! ( "{:?} was terminated by signal" , command ) ,
537+ Some ( code) => format ! ( "{command :?} exited with status: {code}" ) ,
538+ None => format ! ( "{command :?} was terminated by signal" ) ,
542539 } ;
543540
544541 return Err ( io:: Error :: other ( err) ) ;
@@ -696,7 +693,7 @@ fn main() {
696693 }
697694
698695 if let Some ( cpp_lib) = get_cpp_runtime_lib ( & config) {
699- println ! ( "cargo:rustc-link-lib={}" , cpp_lib ) ;
696+ println ! ( "cargo:rustc-link-lib={cpp_lib}" ) ;
700697 }
701698 println ! ( "cargo:rustc-link-lib=static=crypto" ) ;
702699 println ! ( "cargo:rustc-link-lib=static=ssl" ) ;
0 commit comments