File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ impl CommentWithMetadata {
9393 return Self :: new (
9494 comment,
9595 CommentPosition :: Prefix ,
96- last_line. map_or ( true , str:: is_empty) ,
96+ last_line. is_none_or ( str:: is_empty) ,
9797 indent_len,
9898 ) ;
9999 }
Original file line number Diff line number Diff line change @@ -1532,7 +1532,7 @@ impl FunctionDefinition {
15321532 /// Returns `true` if the function body is empty.
15331533 #[ inline]
15341534 pub fn is_empty ( & self ) -> bool {
1535- self . body . as_ref ( ) . map_or ( true , Statement :: is_empty)
1535+ self . body . as_ref ( ) . is_none_or ( Statement :: is_empty)
15361536 }
15371537
15381538 /// Sorts the function attributes.
Original file line number Diff line number Diff line change @@ -1640,8 +1640,8 @@ impl Type {
16401640 match self {
16411641 Type :: Contract ( _) | Type :: Address ( _) => ns. address_length as u8 ,
16421642 Type :: Bool => 1 ,
1643- Type :: Int ( n) => ( ( * n + 7 ) / 8 ) as u8 ,
1644- Type :: Uint ( n) => ( ( * n + 7 ) / 8 ) as u8 ,
1643+ Type :: Int ( n) => ( * n ) . div_ceil ( 8 ) as u8 ,
1644+ Type :: Uint ( n) => ( * n ) . div_ceil ( 8 ) as u8 ,
16451645 Type :: Rational => unreachable ! ( ) ,
16461646 Type :: Bytes ( n) => * n,
16471647 Type :: Enum ( n) => ns. enums [ * n] . ty . bytes ( ns) ,
You can’t perform that action at this time.
0 commit comments