File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -274,8 +274,8 @@ impl fmt::Debug for Error {
274274 match self . name ( ) {
275275 // Print out number if no name can be found.
276276 None => f. debug_tuple ( "Error" ) . field ( & -self . 0 ) . finish ( ) ,
277- // SAFETY: These strings are ASCII-only.
278277 Some ( name) => f
278+ // SAFETY: These strings are ASCII-only.
279279 . debug_tuple ( unsafe { core:: str:: from_utf8_unchecked ( name) } )
280280 . finish ( ) ,
281281 }
@@ -386,6 +386,7 @@ pub(crate) fn from_err_ptr<T>(ptr: *mut T) -> Result<*mut T> {
386386 if unsafe { bindings:: IS_ERR ( const_ptr) } {
387387 // SAFETY: The FFI function does not deref the pointer.
388388 let err = unsafe { bindings:: PTR_ERR ( const_ptr) } ;
389+ #[ allow( clippy:: unnecessary_cast) ]
389390 // CAST: If `IS_ERR()` returns `true`,
390391 // then `PTR_ERR()` is guaranteed to return a
391392 // negative value greater-or-equal to `-bindings::MAX_ERRNO`,
@@ -395,7 +396,6 @@ pub(crate) fn from_err_ptr<T>(ptr: *mut T) -> Result<*mut T> {
395396 //
396397 // SAFETY: `IS_ERR()` ensures `err` is a
397398 // negative value greater-or-equal to `-bindings::MAX_ERRNO`.
398- #[ allow( clippy:: unnecessary_cast) ]
399399 return Err ( unsafe { Error :: from_errno_unchecked ( err as core:: ffi:: c_int ) } ) ;
400400 }
401401 Ok ( ptr)
You can’t perform that action at this time.
0 commit comments