mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
clippy: Fix warnings in components/layout_2020
(#31611)
* clippy: fix warnings in components/layout_2020 * fix: review comments
This commit is contained in:
parent
1d1f239ecc
commit
b03411f567
17 changed files with 59 additions and 69 deletions
|
@ -117,7 +117,7 @@ impl Tag {
|
|||
self.pseudo.is_some()
|
||||
}
|
||||
|
||||
pub(crate) fn to_display_list_fragment_id(&self) -> u64 {
|
||||
pub(crate) fn to_display_list_fragment_id(self) -> u64 {
|
||||
let fragment_type = match self.pseudo {
|
||||
Some(PseudoElement::Before) => FragmentType::BeforePseudoContent,
|
||||
Some(PseudoElement::After) => FragmentType::AfterPseudoContent,
|
||||
|
|
|
@ -74,6 +74,7 @@ pub(crate) struct BoxFragment {
|
|||
}
|
||||
|
||||
impl BoxFragment {
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn new(
|
||||
base_fragment_info: BaseFragmentInfo,
|
||||
style: ServoArc<ComputedValues>,
|
||||
|
@ -108,6 +109,7 @@ impl BoxFragment {
|
|||
)
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn new_with_overconstrained(
|
||||
base_fragment_info: BaseFragmentInfo,
|
||||
style: ServoArc<ComputedValues>,
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ mod base_fragment;
|
|||
mod box_fragment;
|
||||
mod containing_block;
|
||||
mod fragment;
|
||||
#[allow(clippy::module_inception)]
|
||||
mod fragment_tree;
|
||||
mod hoisted_shared_fragment;
|
||||
mod positioning_fragment;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue