Skip to content

Commit f9c4828

Browse files
committed
Fix clippies
Signed-off-by: Sean Young <sean@mess.org>
1 parent 0abb9b6 commit f9c4828

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

fmt/src/comments.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

solang-parser/src/pt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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.

src/sema/types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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),

0 commit comments

Comments
 (0)