Skip to content

Commit 123dc7d

Browse files
committed
Fix warnings reported by clippy
Signed-off-by: Anderson Toshiyuki Sasaki <[email protected]>
1 parent f146fd8 commit 123dc7d

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

keylime-agent/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ mod testing {
982982
TSSError(#[from] tss_esapi::Error),
983983
}
984984

985-
impl<'a> Drop for QuoteData<'a> {
985+
impl Drop for QuoteData<'_> {
986986
/// Flush the created AK when dropping
987987
fn drop(&mut self) {
988988
self.tpmcontext

keylime/src/crypto/x509.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ impl<'a> CertificateBuilder<'a> {
7575
pub fn common_name(
7676
&'a mut self,
7777
cn: &'a str,
78-
) -> &mut CertificateBuilder<'a> {
78+
) -> &'a mut CertificateBuilder<'a> {
7979
self.common_name = Some(cn);
8080
self
8181
}
@@ -88,7 +88,7 @@ impl<'a> CertificateBuilder<'a> {
8888
pub fn hash_algorithm(
8989
&'a mut self,
9090
hash_algorithm: MessageDigest,
91-
) -> &mut CertificateBuilder<'a> {
91+
) -> &'a mut CertificateBuilder<'a> {
9292
self.hash_algorithm = Some(hash_algorithm);
9393
self
9494
}
@@ -102,7 +102,7 @@ impl<'a> CertificateBuilder<'a> {
102102
pub fn not_before(
103103
&'a mut self,
104104
days_from_now: u32,
105-
) -> &mut CertificateBuilder<'a> {
105+
) -> &'a mut CertificateBuilder<'a> {
106106
self.not_before = Some(days_from_now);
107107
self
108108
}
@@ -115,7 +115,7 @@ impl<'a> CertificateBuilder<'a> {
115115
pub fn not_after(
116116
&'a mut self,
117117
days_from_now: u32,
118-
) -> &mut CertificateBuilder<'a> {
118+
) -> &'a mut CertificateBuilder<'a> {
119119
self.not_after = Some(days_from_now);
120120
self
121121
}
@@ -131,7 +131,7 @@ impl<'a> CertificateBuilder<'a> {
131131
pub fn version(
132132
&'a mut self,
133133
version: i32,
134-
) -> &mut CertificateBuilder<'a> {
134+
) -> &'a mut CertificateBuilder<'a> {
135135
self.version = Some(version);
136136
self
137137
}
@@ -144,7 +144,7 @@ impl<'a> CertificateBuilder<'a> {
144144
pub fn private_key(
145145
&'a mut self,
146146
private_key: &'a PKey<Private>,
147-
) -> &mut CertificateBuilder<'a> {
147+
) -> &'a mut CertificateBuilder<'a> {
148148
self.private_key = Some(private_key);
149149
self
150150
}
@@ -158,7 +158,7 @@ impl<'a> CertificateBuilder<'a> {
158158
pub fn add_dns_names(
159159
&'a mut self,
160160
dns_names: Vec<&'a str>,
161-
) -> &mut CertificateBuilder<'a> {
161+
) -> &'a mut CertificateBuilder<'a> {
162162
match &mut self.dns_names {
163163
None => {
164164
self.dns_names = Some(dns_names);
@@ -181,7 +181,7 @@ impl<'a> CertificateBuilder<'a> {
181181
pub fn add_ips(
182182
&'a mut self,
183183
ips: Vec<&'a str>,
184-
) -> &mut CertificateBuilder<'a> {
184+
) -> &'a mut CertificateBuilder<'a> {
185185
match &mut self.ips {
186186
None => {
187187
self.ips = Some(ips);
@@ -204,7 +204,7 @@ impl<'a> CertificateBuilder<'a> {
204204
pub fn add_extensions(
205205
&'a mut self,
206206
extensions: Vec<X509Extension>,
207-
) -> &mut CertificateBuilder<'a> {
207+
) -> &'a mut CertificateBuilder<'a> {
208208
match &mut self.extensions {
209209
None => {
210210
self.extensions = Some(extensions);

keylime/src/hostname_parser.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub fn parse_hostname(hostname: &str) -> Result<&str, HostnameParsingError> {
6060
else {
6161
return Err(HostnameParsingError::InvalidInput(hostname.to_string()));
6262
};
63-
return Ok(pair.as_str());
63+
Ok(pair.as_str())
6464
}
6565

6666
// Unit Testing

keylime/src/ip_parser.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub fn parse_ip(ip: &str) -> Result<&str, IpParsingError> {
8585
else {
8686
return Err(IpParsingError::InvalidInput(ip.to_string()));
8787
};
88-
return get_inner_ip(pair);
88+
get_inner_ip(pair)
8989
}
9090

9191
// Unit Testing

keylime/src/tpm.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ pub struct Context<'a> {
487487

488488
static TPM_CTX: OnceLock<Arc<Mutex<tss_esapi::Context>>> = OnceLock::new();
489489

490-
impl<'a> Context<'a> {
490+
impl Context<'_> {
491491
/// Creates a connection context.
492492
pub fn new() -> Result<Self> {
493493
let tcti_path = match std::env::var("TCTI") {

0 commit comments

Comments
 (0)