clippy: Fix warnings in components/layout_2020 (#31611)

* clippy: fix warnings in components/layout_2020

* fix: review comments
This commit is contained in:
eri 2024-03-11 15:24:33 +01:00 committed by GitHub
parent 1d1f239ecc
commit b03411f567
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 59 additions and 69 deletions

View file

@ -56,16 +56,12 @@ pub(crate) enum AbsoluteBoxOffsets {
impl AbsoluteBoxOffsets {
pub(crate) fn both_specified(&self) -> bool {
match self {
AbsoluteBoxOffsets::Both { .. } => true,
_ => false,
}
matches!(self, AbsoluteBoxOffsets::Both { .. })
}
pub(crate) fn adjust_offset(&mut self, new_offset: Length) {
match *self {
AbsoluteBoxOffsets::StaticStart { ref mut start } => *start = new_offset,
_ => (),
if let AbsoluteBoxOffsets::StaticStart { ref mut start } = *self {
*start = new_offset
}
}
}