@@ -237,10 +237,7 @@ impl BuildOptions {
237
237
min_python_minor,
238
238
) ?;
239
239
let host_python = & host_interpreters[ 0 ] ;
240
- println ! (
241
- "🐍 Using host {} for cross-compiling preparation" ,
242
- host_python
243
- ) ;
240
+ println ! ( "🐍 Using host {host_python} for cross-compiling preparation" ) ;
244
241
// pyo3
245
242
env:: set_var ( "PYO3_PYTHON" , & host_python. executable ) ;
246
243
// rust-cpython, and legacy pyo3 versions
@@ -320,14 +317,14 @@ impl BuildOptions {
320
317
. map ( ToString :: to_string)
321
318
. collect :: < Vec < String > > ( )
322
319
. join ( ", " ) ;
323
- println ! ( "🐍 Found {}" , interpreters_str ) ;
320
+ println ! ( "🐍 Found {interpreters_str}" ) ;
324
321
325
322
Ok ( interpreters)
326
323
}
327
324
BridgeModel :: Cffi => {
328
325
let interpreter =
329
326
find_single_python_interpreter ( bridge, interpreter, target, "cffi" ) ?;
330
- println ! ( "🐍 Using {} to generate the cffi bindings" , interpreter ) ;
327
+ println ! ( "🐍 Using {interpreter } to generate the cffi bindings" ) ;
331
328
Ok ( vec ! [ interpreter] )
332
329
}
333
330
BridgeModel :: Bin ( None ) | BridgeModel :: UniFfi => Ok ( vec ! [ ] ) ,
@@ -364,7 +361,7 @@ impl BuildOptions {
364
361
soabi: None ,
365
362
} ] )
366
363
} else if let Some ( interp) = interpreters. get ( 0 ) {
367
- println ! ( "🐍 Using {} to generate to link bindings (With abi3, an interpreter is only required on windows)" , interp ) ;
364
+ println ! ( "🐍 Using {interp } to generate to link bindings (With abi3, an interpreter is only required on windows)" ) ;
368
365
Ok ( interpreters)
369
366
} else if generate_import_lib {
370
367
println ! ( "🐍 Not using a specific python interpreter (Automatically generating windows import library)" ) ;
@@ -617,10 +614,7 @@ impl BuildOptions {
617
614
618
615
for platform_tag in & platform_tags {
619
616
if !platform_tag. is_supported ( ) {
620
- eprintln ! (
621
- "⚠️ Warning: {} is unsupported by the Rust compiler." ,
622
- platform_tag
623
- ) ;
617
+ eprintln ! ( "⚠️ Warning: {platform_tag} is unsupported by the Rust compiler." ) ;
624
618
}
625
619
}
626
620
@@ -771,7 +765,7 @@ fn has_abi3(cargo_metadata: &Metadata) -> Result<Option<(u8, u8)>> {
771
765
) )
772
766
} )
773
767
. collect :: < Result < Vec < ( u8 , u8 ) > > > ( )
774
- . context ( format ! ( "Bogus {} cargo features" , lib ) ) ?
768
+ . context ( format ! ( "Bogus {lib } cargo features" ) ) ?
775
769
. into_iter ( )
776
770
. min ( ) ;
777
771
if abi3_selected && min_abi3_version. is_none ( ) {
@@ -920,7 +914,7 @@ pub fn find_bridge(cargo_metadata: &Metadata, bridge: Option<&str>) -> Result<Br
920
914
} ;
921
915
922
916
if !( bridge. is_bindings ( "pyo3" ) || bridge. is_bindings ( "pyo3-ffi" ) ) {
923
- println ! ( "🔗 Found {} bindings" , bridge ) ;
917
+ println ! ( "🔗 Found {bridge } bindings" ) ;
924
918
}
925
919
926
920
for & lib in PYO3_BINDING_CRATES . iter ( ) {
@@ -929,21 +923,17 @@ pub fn find_bridge(cargo_metadata: &Metadata, bridge: Option<&str>) -> Result<Br
929
923
if !pyo3_node. features . contains ( & "extension-module" . to_string ( ) ) {
930
924
let version = cargo_metadata[ & pyo3_node. id ] . version . to_string ( ) ;
931
925
eprintln ! (
932
- "⚠️ Warning: You're building a library without activating {}'s \
926
+ "⚠️ Warning: You're building a library without activating {lib }'s \
933
927
`extension-module` feature. \
934
- See https://pyo3.rs/v{}/building_and_distribution.html#linking",
935
- lib, version
928
+ See https://pyo3.rs/v{version}/building_and_distribution.html#linking"
936
929
) ;
937
930
}
938
931
939
932
return if let Some ( ( major, minor) ) = has_abi3 ( cargo_metadata) ? {
940
- println ! (
941
- "🔗 Found {} bindings with abi3 support for Python ≥ {}.{}" ,
942
- lib, major, minor
943
- ) ;
933
+ println ! ( "🔗 Found {lib} bindings with abi3 support for Python ≥ {major}.{minor}" ) ;
944
934
Ok ( BridgeModel :: BindingsAbi3 ( major, minor) )
945
935
} else {
946
- println ! ( "🔗 Found {} bindings" , lib ) ;
936
+ println ! ( "🔗 Found {lib } bindings" ) ;
947
937
Ok ( bridge)
948
938
} ;
949
939
}
@@ -1074,16 +1064,10 @@ fn find_interpreter_in_sysconfig(
1074
1064
. split_once ( '.' )
1075
1065
. context ( "Invalid python interpreter version" ) ?;
1076
1066
let ver_major = ver_major. parse :: < usize > ( ) . with_context ( || {
1077
- format ! (
1078
- "Invalid python interpreter major version '{}', expect a digit" ,
1079
- ver_major
1080
- )
1067
+ format ! ( "Invalid python interpreter major version '{ver_major}', expect a digit" )
1081
1068
} ) ?;
1082
1069
let ver_minor = ver_minor. parse :: < usize > ( ) . with_context ( || {
1083
- format ! (
1084
- "Invalid python interpreter minor version '{}', expect a digit" ,
1085
- ver_minor
1086
- )
1070
+ format ! ( "Invalid python interpreter minor version '{ver_minor}', expect a digit" )
1087
1071
} ) ?;
1088
1072
let sysconfig = InterpreterConfig :: lookup (
1089
1073
target. target_os ( ) ,
@@ -1092,10 +1076,7 @@ fn find_interpreter_in_sysconfig(
1092
1076
( ver_major, ver_minor) ,
1093
1077
)
1094
1078
. with_context ( || {
1095
- format ! (
1096
- "Failed to find a {} {}.{} interpreter" ,
1097
- python_impl, ver_major, ver_minor
1098
- )
1079
+ format ! ( "Failed to find a {python_impl} {ver_major}.{ver_minor} interpreter" )
1099
1080
} ) ?;
1100
1081
debug ! (
1101
1082
"Found {} {}.{} in bundled sysconfig" ,
0 commit comments