Skip to content

Commit c61925b

Browse files
committed
clippy: fix warnings
1 parent 4053a34 commit c61925b

File tree

9 files changed

+11
-11
lines changed

9 files changed

+11
-11
lines changed

float-pigment-css/src/check_trait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use alloc::{boxed::Box, string::String, vec::Vec};
22
use core::cell::Cell;
33

44
use crate::sheet::str_store::StrBuffer;
5-
5+
#[allow(dead_code)]
66
pub trait CompatibilityCheck {
77
fn check() {}
88
}

float-pigment-css/src/query.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ impl PartialEq for MatchedRule {
349349

350350
impl PartialOrd for MatchedRule {
351351
fn partial_cmp(&self, other: &Self) -> Option<core::cmp::Ordering> {
352-
Some(self.weight.normal().cmp(&other.weight.normal()))
352+
Some(self.cmp(other))
353353
}
354354
}
355355

float-pigment-css/src/sheet/borrow.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,11 +1073,11 @@ impl<T> Array<T> {
10731073
self.arr.into_vec()
10741074
}
10751075

1076-
pub fn iter(&self) -> core::slice::Iter<T> {
1076+
pub fn iter(&self) -> core::slice::Iter<'_, T> {
10771077
self.arr.iter()
10781078
}
10791079

1080-
pub fn iter_mut(&mut self) -> core::slice::IterMut<T> {
1080+
pub fn iter_mut(&mut self) -> core::slice::IterMut<'_, T> {
10811081
self.arr.iter_mut()
10821082
}
10831083

float-pigment-css/src/sheet/rule.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ impl PropertyMeta {
181181
}
182182

183183
/// Get an iterate of the properties.
184-
pub fn iter(&self) -> PropertyMetaIter {
184+
pub fn iter(&self) -> PropertyMetaIter<'_> {
185185
PropertyMetaIter { pm: self, cur: 0 }
186186
}
187187

float-pigment-forest/src/node.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,10 @@ impl Node {
257257
pub fn children_len(&self) -> usize {
258258
self.children.borrow().len()
259259
}
260-
pub(crate) fn style_manager(&self) -> Ref<StyleManager> {
260+
pub(crate) fn style_manager(&self) -> Ref<'_, StyleManager> {
261261
self.style_manager.borrow()
262262
}
263-
pub(crate) fn style_manager_mut(&self) -> RefMut<StyleManager> {
263+
pub(crate) fn style_manager_mut(&self) -> RefMut<'_, StyleManager> {
264264
self.style_manager.borrow_mut()
265265
}
266266
pub(crate) fn computed_style(&self) -> ComputedStyle<Len> {

float-pigment-layout/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ impl<T: LayoutTreeNode> LayoutNode<T> {
351351
}
352352

353353
#[inline]
354-
pub(crate) fn unit(&self) -> RefMut<LayoutUnit<T>> {
354+
pub(crate) fn unit(&self) -> RefMut<'_, LayoutUnit<T>> {
355355
self.unit.borrow_mut()
356356
}
357357
}

float-pigment-layout/src/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ impl<L: LengthNum> MinMaxLimit<L> {
851851
x.maybe_min(self.max_height).max(self.min_height)
852852
}
853853

854-
pub(crate) fn maybe(&self) -> MinMaxLimitMaybe<L> {
854+
pub(crate) fn maybe(&self) -> MinMaxLimitMaybe<'_, L> {
855855
MinMaxLimitMaybe(self)
856856
}
857857

float-pigment-mlp/src/node/element.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl Element {
3434
pub fn tag(&self) -> &str {
3535
self.tag.as_str()
3636
}
37-
pub fn children_mut(&self) -> RefMut<Vec<Rc<NodeType>>> {
37+
pub fn children_mut(&self) -> RefMut<'_, Vec<Rc<NodeType>>> {
3838
self.children.borrow_mut()
3939
}
4040
pub fn for_each_child(&self, f: Box<dyn Fn(&NodeType)>) {

float-pigment-mlp/src/node/fragment.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ impl Fragment {
2020
pub fn for_each_child(&self, f: Box<dyn Fn(&NodeType)>) {
2121
self.0.borrow().iter().for_each(|item| f(item.as_ref()))
2222
}
23-
pub fn children_mut(&self) -> RefMut<Vec<Rc<NodeType>>> {
23+
pub fn children_mut(&self) -> RefMut<'_, Vec<Rc<NodeType>>> {
2424
self.0.borrow_mut()
2525
}
2626
}

0 commit comments

Comments
 (0)