File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -276,8 +276,8 @@ impl fmt::Debug for Error {
276276 match self . name ( ) {
277277 // Print out number if no name can be found.
278278 None => f. debug_tuple ( "Error" ) . field ( & -self . 0 ) . finish ( ) ,
279- // SAFETY: These strings are ASCII-only.
280279 Some ( name) => f
280+ // SAFETY: These strings are ASCII-only.
281281 . debug_tuple ( unsafe { core:: str:: from_utf8_unchecked ( name) } )
282282 . finish ( ) ,
283283 }
@@ -382,6 +382,7 @@ pub(crate) fn from_err_ptr<T>(ptr: *mut T) -> Result<*mut T> {
382382 if unsafe { bindings:: IS_ERR ( const_ptr) } {
383383 // SAFETY: The FFI function does not deref the pointer.
384384 let err = unsafe { bindings:: PTR_ERR ( const_ptr) } ;
385+ #[ allow( clippy:: unnecessary_cast) ]
385386 // CAST: If `IS_ERR()` returns `true`,
386387 // then `PTR_ERR()` is guaranteed to return a
387388 // negative value greater-or-equal to `-bindings::MAX_ERRNO`,
@@ -391,7 +392,6 @@ pub(crate) fn from_err_ptr<T>(ptr: *mut T) -> Result<*mut T> {
391392 //
392393 // SAFETY: `IS_ERR()` ensures `err` is a
393394 // negative value greater-or-equal to `-bindings::MAX_ERRNO`.
394- #[ allow( clippy:: unnecessary_cast) ]
395395 return Err ( unsafe { Error :: from_errno_unchecked ( err as core:: ffi:: c_int ) } ) ;
396396 }
397397 Ok ( ptr)
You can’t perform that action at this time.
0 commit comments