Skip to content

Commit ce52222

Browse files
authored
FSM: Remove needless lifetime annotations (#1105)
This PR resolves a clippy::needless_lifetimes warning found in the create_test_config test helper function. The explicit 'a lifetime annotation was unnecessary, as Rust's lifetime elision rules can correctly infer the lifetime of the input &str and the returned NegotiationConfig. The function signature has been updated to remove the explicit lifetime, making the code more idiomatic. Signed-off-by: Sergio Arroutbi <[email protected]>
1 parent 445b12b commit ce52222

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

keylime-push-model-agent/src/state_machine.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -369,13 +369,13 @@ mod tpm_tests {
369369
}
370370

371371
/// Helper function to create TPM test configuration.
372-
fn create_tpm_test_config<'a>(
373-
url: &'a str,
372+
fn create_tpm_test_config(
373+
url: &str,
374374
timeout: u64,
375375
max_retries: u32,
376376
initial_delay_ms: u64,
377377
max_delay_ms: Option<u64>,
378-
) -> NegotiationConfig<'a> {
378+
) -> NegotiationConfig<'_> {
379379
NegotiationConfig {
380380
avoid_tpm: true,
381381
ca_certificate: "",
@@ -728,13 +728,13 @@ mod tests {
728728
use crate::attestation::{AttestationClient, NegotiationConfig};
729729

730730
// Helper function to create test configuration.
731-
fn create_test_config<'a>(
732-
url: &'a str,
731+
fn create_test_config(
732+
url: &str,
733733
timeout: u64,
734734
max_retries: u32,
735735
initial_delay_ms: u64,
736736
max_delay_ms: Option<u64>,
737-
) -> NegotiationConfig<'a> {
737+
) -> NegotiationConfig<'_> {
738738
NegotiationConfig {
739739
avoid_tpm: true,
740740
ca_certificate: "",

0 commit comments

Comments
 (0)