@@ -161,7 +161,7 @@ impl Context {
161
161
& mut status,
162
162
)
163
163
} ;
164
- if service_context == null_mut ( ) {
164
+ if service_context. is_null ( ) {
165
165
return Err ( Error :: new (
166
166
ErrorKind :: Other ,
167
167
"Failed to obtain a Trusted Service context" ,
@@ -181,7 +181,7 @@ impl Context {
181
181
info ! ( "Starting crypto Trusted Service context" ) ;
182
182
let mut rpc_caller = null_mut ( ) ;
183
183
let rpc_session_handle = unsafe { service_context_open ( service_context, & mut rpc_caller) } ;
184
- if rpc_caller == null_mut ( ) || rpc_session_handle == null_mut ( ) {
184
+ if rpc_caller. is_null ( ) || rpc_session_handle. is_null ( ) {
185
185
return Err (
186
186
Error :: new ( ErrorKind :: Other , "Failed to start Trusted Service context" ) . into ( ) ,
187
187
) ;
@@ -209,10 +209,10 @@ impl Context {
209
209
let mut buf_out = null_mut ( ) ;
210
210
let call_handle =
211
211
unsafe { rpc_caller_begin ( self . rpc_caller , & mut buf_out, req. encoded_len ( ) ) } ;
212
- if call_handle == null_mut ( ) {
212
+ if call_handle. is_null ( ) {
213
213
error ! ( "Call handle was null" ) ;
214
214
return Err ( PsaError :: CommunicationFailure ) ;
215
- } else if buf_out == null_mut ( ) {
215
+ } else if buf_out. is_null ( ) {
216
216
error ! ( "Call buffer was null" ) ;
217
217
return Err ( PsaError :: CommunicationFailure ) ;
218
218
}
0 commit comments