Skip to content

Commit 450d20e

Browse files
committed
Fixed Rust 1.62 clippy errors for 7.x.y branch.
Signed-off-by: Jesper Brynolf <[email protected]>
1 parent 36d2246 commit 450d20e

File tree

4 files changed

+27
-23
lines changed

4 files changed

+27
-23
lines changed

tss-esapi/src/abstraction/pcr/data.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl PcrData {
101101
}
102102
}
103103

104-
impl<'a> IntoIterator for PcrData {
104+
impl IntoIterator for PcrData {
105105
type Item = (HashingAlgorithm, PcrBank);
106106
type IntoIter = ::std::vec::IntoIter<(HashingAlgorithm, PcrBank)>;
107107

tss-esapi/tests/integration_tests/abstraction_tests/nv_tests.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ fn list() {
8080
.map(|(public, _)| public.nv_index())
8181
.any(|x| x == nv_index));
8282

83-
let _ = context
83+
context
8484
.nv_undefine_space(Provision::Owner, owner_nv_index_handle)
85-
.unwrap();
85+
.expect("Call to nv_undefine_space failed");
8686
}
8787

8888
#[test]
@@ -96,9 +96,9 @@ fn read_full() {
9696
// Now read it back
9797
let read_result = nv::read_full(&mut context, NvAuth::Owner, nv_index);
9898

99-
let _ = context
99+
context
100100
.nv_undefine_space(Provision::Owner, owner_nv_index_handle)
101-
.unwrap();
101+
.expect("Call to nv_undefine_space failed");
102102

103103
let read_result = read_result.unwrap();
104104
assert_eq!(read_result.len(), 1540);
@@ -154,8 +154,8 @@ fn write() {
154154

155155
let owner_nv_index_handle = context
156156
.execute_without_session(|ctx| ctx.tr_from_tpm_public(nv_index.into()))
157-
.unwrap();
157+
.expect("Call to tr_from_tpm_public failed");
158158
context
159159
.nv_undefine_space(Provision::Owner, owner_nv_index_handle.into())
160-
.unwrap();
160+
.expect("Call to nv_undefine_space failed");
161161
}

tss-esapi/tests/integration_tests/context_tests/general_esys_tr_tests.rs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ mod test_tr_from_tpm_public {
6363
fn_name: &str|
6464
-> tss_esapi::Error {
6565
// Set password authorization
66-
let _ = context.nv_undefine_space(Provision::Owner, handle).unwrap();
66+
context
67+
.nv_undefine_space(Provision::Owner, handle)
68+
.expect("Call to nv_undefine_space failed");
6769
panic!("{} failed: {}", fn_name, e);
6870
};
6971

@@ -113,9 +115,9 @@ mod test_tr_from_tpm_public {
113115
.unwrap();
114116
//////////////////////////////////////////////
115117
// Remove undefine the space
116-
let _ = context
118+
context
117119
.nv_undefine_space(Provision::Owner, new_nv_index_handle.into())
118-
.unwrap();
120+
.expect("Call to nv_undefine_space failed");
119121

120122
assert_eq!(expected_name, actual_name);
121123
}
@@ -140,7 +142,7 @@ mod test_tr_from_tpm_public {
140142
-> tss_esapi::Error {
141143
// Set password authorization
142144
context.set_sessions((Some(AuthSession::Password), None, None));
143-
let _ = context
145+
context
144146
.nv_undefine_space(Provision::Owner, handle)
145147
.expect("Failed to call nv_undefine_space");
146148
panic!("{} failed: {}", fn_name, e);
@@ -213,9 +215,9 @@ mod test_tr_from_tpm_public {
213215
//
214216
// Set password authorization
215217
context.set_sessions((Some(AuthSession::Password), None, None));
216-
let _ = context
218+
context
217219
.nv_undefine_space(Provision::Owner, new_nv_index_handle.into())
218-
.expect("Failed to call nv_undefine_space");
220+
.expect("Call to nv_undefine_space failed");
219221
///////////////////////////////////////////////////////////////
220222
// Check that we got the correct name
221223
//
@@ -243,7 +245,9 @@ mod test_tr_from_tpm_public {
243245
-> tss_esapi::Error {
244246
// Set password authorization
245247
context.set_sessions((Some(AuthSession::Password), None, None));
246-
let _ = context.nv_undefine_space(Provision::Owner, handle).unwrap();
248+
context
249+
.nv_undefine_space(Provision::Owner, handle)
250+
.expect("Call to nv_undefine_space failed");
247251
panic!("{} failed: {}", fn_name, e);
248252
};
249253

@@ -362,9 +366,9 @@ mod test_tr_from_tpm_public {
362366
//
363367
// Set password authorization
364368
context.set_sessions((Some(AuthSession::Password), None, None));
365-
let _ = context
369+
context
366370
.nv_undefine_space(Provision::Owner, new_nv_index_handle)
367-
.unwrap();
371+
.expect("Call to nv_undefine_space failed");
368372
///////////////////////////////////////////////////////////////
369373
// The name will have changed
370374
//

tss-esapi/tests/integration_tests/context_tests/tpm_commands/non_volatile_storage_tests.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ mod test_nv_define_space {
9797
.nv_define_space(Provision::Owner, None, owner_nv_public)
9898
.expect("Call to nv_define_space failed");
9999

100-
let _ = context
100+
context
101101
.nv_undefine_space(Provision::Owner, owner_nv_index_handle)
102102
.expect("Call to nv_undefine_space failed");
103103

@@ -108,7 +108,7 @@ mod test_nv_define_space {
108108
.nv_define_space(Provision::Platform, None, platform_nv_public)
109109
.expect("Call to nv_define_space failed");
110110

111-
let _ = context
111+
context
112112
.nv_undefine_space(Provision::Platform, platform_nv_index_handle)
113113
.expect("Call to nv_undefine_space failed");
114114
}
@@ -149,7 +149,7 @@ mod test_nv_undefine_space {
149149
.expect("Call to nv_define_space failed");
150150

151151
// Succeeds
152-
let _ = context
152+
context
153153
.nv_undefine_space(Provision::Owner, owner_nv_index_handle)
154154
.expect("Call to nv_undefine_space failed");
155155
}
@@ -190,9 +190,9 @@ mod test_nv_read_public {
190190

191191
let read_public_result = context.nv_read_public(nv_index_handle);
192192

193-
let _ = context
193+
context
194194
.nv_undefine_space(Provision::Owner, nv_index_handle)
195-
.unwrap();
195+
.expect("Call to nv_undefine_space failed");
196196

197197
// Report error
198198
if let Err(e) = read_public_result {
@@ -250,7 +250,7 @@ mod test_nv_write {
250250
0,
251251
);
252252

253-
let _ = context
253+
context
254254
.nv_undefine_space(Provision::Owner, owner_nv_index_handle)
255255
.expect("Call to nv_undefine_space failed");
256256

@@ -311,7 +311,7 @@ mod test_nv_read {
311311
// read data using owner authorization
312312
let read_result =
313313
context.nv_read(NvAuth::Owner, owner_nv_index_handle, value.len() as u16, 0);
314-
let _ = context
314+
context
315315
.nv_undefine_space(Provision::Owner, owner_nv_index_handle)
316316
.expect("Call to nv_undefine_space failed");
317317

0 commit comments

Comments
 (0)