File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -147,7 +147,6 @@ mod _io {
147147 use num_traits:: ToPrimitive ;
148148 use std:: io:: { self , Cursor , SeekFrom , prelude:: * } ;
149149
150- #[ allow( clippy:: let_and_return) ]
151150 fn validate_whence ( whence : i32 ) -> bool {
152151 host_io:: validate_whence ( whence)
153152 }
@@ -204,7 +203,7 @@ mod _io {
204203 ) )
205204 }
206205
207- #[ derive( FromArgs ) ]
206+ #[ derive( Clone , Copy , FromArgs ) ]
208207 pub ( super ) struct OptionalSize {
209208 // In a few functions, the default value is -1 rather than None.
210209 // Make sure the default value doesn't affect compatibility.
@@ -213,7 +212,6 @@ mod _io {
213212 }
214213
215214 impl OptionalSize {
216- #[ allow( clippy:: wrong_self_convention) ]
217215 pub ( super ) fn to_usize ( self ) -> Option < usize > {
218216 self . size ?. to_usize ( )
219217 }
@@ -2907,7 +2905,7 @@ mod _io {
29072905 Ok ( ( ) )
29082906 }
29092907
2910- #[ allow ( clippy:: type_complexity) ]
2908+ #[ expect ( clippy:: type_complexity, reason = "ignore warning for now" ) ]
29112909 fn find_coder (
29122910 buffer : & PyObject ,
29132911 encoding : & str ,
Original file line number Diff line number Diff line change @@ -653,7 +653,10 @@ pub(super) mod _os {
653653 match self . stat ( self . stat_dir_fd ( ) , FollowSymlinks ( follow_symlinks) , vm) {
654654 Ok ( stat_obj) => {
655655 let st_mode: i32 = stat_obj. get_attr ( "st_mode" , vm) ?. try_into_value ( vm) ?;
656- #[ allow( clippy:: unnecessary_cast) ]
656+ #[ allow(
657+ clippy:: unnecessary_cast,
658+ reason = "'st_mode' and 'S_IFMT' are not u32 on all platforms"
659+ ) ]
657660 Ok ( ( st_mode as u32 & libc:: S_IFMT as u32 ) == mode_bits)
658661 }
659662 Err ( e) => {
@@ -1244,6 +1247,7 @@ pub(super) mod _os {
12441247 #[ cfg( not( windows) ) ]
12451248 #[ allow( clippy:: useless_conversion, reason = "needed for 32-bit platforms" ) ]
12461249 let st_blksize = i64:: from ( stat. st_blksize ) ;
1250+
12471251 #[ cfg( not( windows) ) ]
12481252 #[ allow( clippy:: useless_conversion, reason = "needed for 32-bit platforms" ) ]
12491253 let st_blocks = i64:: from ( stat. st_blocks ) ;
You can’t perform that action at this time.
0 commit comments