@@ -72,7 +72,7 @@ fn list() {
72
72
. map( |( public, _) | public. nv_index( ) )
73
73
. any( |x| x == nv_index) ) ;
74
74
75
- let _owner_nv_index_handle = write_nv_index ( & mut context, nv_index) ;
75
+ let owner_nv_index_handle = write_nv_index ( & mut context, nv_index) ;
76
76
77
77
assert ! ( nv:: list( & mut context)
78
78
. unwrap( )
@@ -83,7 +83,7 @@ fn list() {
83
83
// Need to get the ESYS handle again, as it was closed by nv::list above
84
84
let owner_nv_index_handle = context
85
85
. tr_from_tpm_public ( nv_index. into ( ) )
86
- . expect ( "Failed to get ObjectHandle for NV Index" ) ;
86
+ . unwrap_or_else ( |_| owner_nv_index_handle . into ( ) ) ;
87
87
context
88
88
. nv_undefine_space ( Provision :: Owner , owner_nv_index_handle. into ( ) )
89
89
. expect ( "Call to nv_undefine_space failed" ) ;
@@ -95,15 +95,15 @@ fn read_full() {
95
95
96
96
let nv_index = NvIndexTpmHandle :: new ( 0x01500015 ) . unwrap ( ) ;
97
97
98
- let _owner_nv_index_handle = write_nv_index ( & mut context, nv_index) ;
98
+ let owner_nv_index_handle = write_nv_index ( & mut context, nv_index) ;
99
99
100
100
// Now read it back
101
101
let read_result = nv:: read_full ( & mut context, NvAuth :: Owner , nv_index) ;
102
102
103
103
// Need to get the ESYS handle again, as it was closed by nv::read_full above
104
104
let owner_nv_index_handle = context
105
105
. tr_from_tpm_public ( nv_index. into ( ) )
106
- . expect ( "Failed to get ObjectHandle for NV Index" ) ;
106
+ . unwrap_or_else ( |_| owner_nv_index_handle . into ( ) ) ;
107
107
context
108
108
. nv_undefine_space ( Provision :: Owner , owner_nv_index_handle. into ( ) )
109
109
. expect ( "Call to nv_undefine_space failed" ) ;
0 commit comments