Skip to content

Commit e7a5b50

Browse files
authored
Merge pull request #107 from Rust-for-Linux/dev/fix-clippy
replace clippy `expect` with `allow`
2 parents 9a092f8 + 3fe4cc1 commit e7a5b50

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,13 +1143,13 @@ pub const unsafe fn init_from_closure<T: ?Sized, E>(
11431143
///
11441144
/// - `*mut U` must be castable to `*mut T` and any value of type `T` written through such a
11451145
/// pointer must result in a valid `U`.
1146-
#[expect(clippy::let_and_return)]
11471146
pub const unsafe fn cast_pin_init<T, U, E>(init: impl PinInit<T, E>) -> impl PinInit<U, E> {
11481147
// SAFETY: initialization delegated to a valid initializer. Cast is valid by function safety
11491148
// requirements.
11501149
let res = unsafe { pin_init_from_closure(|ptr: *mut U| init.__pinned_init(ptr.cast::<T>())) };
11511150
// FIXME: remove the let statement once the nightly-MSRV allows it (1.78 otherwise encounters a
11521151
// cycle when computing the type returned by this function)
1152+
#[allow(clippy::let_and_return)]
11531153
res
11541154
}
11551155

@@ -1159,13 +1159,13 @@ pub const unsafe fn cast_pin_init<T, U, E>(init: impl PinInit<T, E>) -> impl Pin
11591159
///
11601160
/// - `*mut U` must be castable to `*mut T` and any value of type `T` written through such a
11611161
/// pointer must result in a valid `U`.
1162-
#[expect(clippy::let_and_return)]
11631162
pub const unsafe fn cast_init<T, U, E>(init: impl Init<T, E>) -> impl Init<U, E> {
11641163
// SAFETY: initialization delegated to a valid initializer. Cast is valid by function safety
11651164
// requirements.
11661165
let res = unsafe { init_from_closure(|ptr: *mut U| init.__init(ptr.cast::<T>())) };
11671166
// FIXME: remove the let statement once the nightly-MSRV allows it (1.78 otherwise encounters a
11681167
// cycle when computing the type returned by this function)
1168+
#[allow(clippy::let_and_return)]
11691169
res
11701170
}
11711171

0 commit comments

Comments
 (0)