Skip to content

Commit 37d8fb1

Browse files
committed
Apply nightly clippy suggestions
1 parent b49fa5f commit 37d8fb1

5 files changed

Lines changed: 8 additions & 18 deletions

File tree

librustls/build.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ fn main() {
3232
let pkg_version = env!("CARGO_PKG_VERSION");
3333
writeln!(
3434
&mut f,
35-
r#"const RUSTLS_FFI_VERSION: &str = "rustls-ffi/{}/rustls/{}/{}";"#,
36-
pkg_version, RUSTLS_CRATE_VERSION, rustls_crypto_provider
35+
r#"const RUSTLS_FFI_VERSION: &str = "rustls-ffi/{pkg_version}/rustls/{RUSTLS_CRATE_VERSION}/{rustls_crypto_provider}";"#,
3736
)
3837
.expect("Could not write file");
3938

librustls/src/cipher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ mod tests {
7777
let name = rustls_supported_ciphersuite_get_name(suite);
7878
let name = unsafe { name.to_str() };
7979
let proto = rustls_supported_ciphersuite_protocol_version(suite);
80-
println!("{}: {} {:?}", i, name, proto);
80+
println!("{i}: {name} {proto:?}");
8181
}
8282
}
8383
}

librustls/src/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ mod tests {
859859
&mut conn,
860860
);
861861
if !matches!(result, rustls_result::Ok) {
862-
panic!("expected RUSTLS_RESULT_OK, got {:?}", result);
862+
panic!("expected RUSTLS_RESULT_OK, got {result:?}");
863863
}
864864
assert!(!rustls_connection::rustls_connection_wants_read(conn));
865865
assert!(rustls_connection::rustls_connection_wants_write(conn));
@@ -919,7 +919,7 @@ mod tests {
919919
&mut conn,
920920
);
921921
if !matches!(result, rustls_result::Ok) {
922-
panic!("expected RUSTLS_RESULT_OK, got {:?}", result);
922+
panic!("expected RUSTLS_RESULT_OK, got {result:?}");
923923
}
924924
rustls_server_cert_verifier::rustls_server_cert_verifier_free(verifier);
925925
}

librustls/src/rslice.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,7 @@ mod tests {
267267
fn test_rustls_str_debug() {
268268
let s = "abcd";
269269
let rs: rustls_str = s.try_into().unwrap();
270-
assert_eq!(
271-
format!("{:?}", rs),
272-
r#"rustls_str { data: "abcd", len: 4 }"#
273-
);
270+
assert_eq!(format!("{rs:?}"), r#"rustls_str { data: "abcd", len: 4 }"#);
274271
}
275272
}
276273

librustls/src/server.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -777,10 +777,7 @@ mod tests {
777777
&mut certified_key,
778778
);
779779
if !matches!(result, rustls_result::Ok) {
780-
panic!(
781-
"expected RUSTLS_RESULT_OK from rustls_certified_key_build, got {:?}",
782-
result
783-
);
780+
panic!("expected RUSTLS_RESULT_OK from rustls_certified_key_build, got {result:?}");
784781
}
785782
rustls_server_config_builder::rustls_server_config_builder_set_certified_keys(
786783
builder,
@@ -827,10 +824,7 @@ mod tests {
827824
&mut certified_key,
828825
);
829826
if !matches!(result, rustls_result::Ok) {
830-
panic!(
831-
"expected RUSTLS_RESULT_OK from rustls_certified_key_build, got {:?}",
832-
result
833-
);
827+
panic!("expected RUSTLS_RESULT_OK from rustls_certified_key_build, got {result:?}");
834828
}
835829
rustls_server_config_builder::rustls_server_config_builder_set_certified_keys(
836830
builder,
@@ -847,7 +841,7 @@ mod tests {
847841
let mut conn = null_mut();
848842
let result = rustls_server_config::rustls_server_connection_new(config, &mut conn);
849843
if !matches!(result, rustls_result::Ok) {
850-
panic!("expected RUSTLS_RESULT_OK, got {:?}", result);
844+
panic!("expected RUSTLS_RESULT_OK, got {result:?}");
851845
}
852846
assert!(rustls_connection::rustls_connection_wants_read(conn));
853847
assert!(!rustls_connection::rustls_connection_wants_write(conn));

0 commit comments

Comments
 (0)