mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Lint layout_2013 with clippy (#31221)
* Lint layout_2013 with clippy CARGO_BUILD_RUSTC=rustc cargo clippy --fix -p layout_2013 --broken-code * ./mach fmt * Cosmetic adjustments
This commit is contained in:
parent
16cabcf736
commit
f7ead9bcb6
28 changed files with 490 additions and 483 deletions
|
@ -96,7 +96,7 @@ impl FlowList {
|
|||
/// SECURITY-NOTE(pcwalton): This does not hand out `FlowRef`s by design. Do not add a method
|
||||
/// to do so! See the comment above in `FlowList`.
|
||||
#[inline]
|
||||
pub fn iter<'a>(&'a self) -> FlowListIterator {
|
||||
pub fn iter(&self) -> FlowListIterator {
|
||||
FlowListIterator {
|
||||
it: self.flows.iter(),
|
||||
}
|
||||
|
@ -141,6 +141,12 @@ impl FlowList {
|
|||
}
|
||||
}
|
||||
|
||||
impl Default for FlowList {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> DoubleEndedIterator for FlowListIterator<'a> {
|
||||
fn next_back(&mut self) -> Option<&'a dyn Flow> {
|
||||
self.it.next_back().map(Deref::deref)
|
||||
|
@ -187,7 +193,7 @@ pub struct FlowListRandomAccessMut<'a> {
|
|||
}
|
||||
|
||||
impl<'a> FlowListRandomAccessMut<'a> {
|
||||
pub fn get<'b>(&'b mut self, index: usize) -> &'b mut dyn Flow {
|
||||
pub fn get(&mut self, index: usize) -> &mut dyn Flow {
|
||||
while index >= self.cache.len() {
|
||||
match self.iterator.next() {
|
||||
None => panic!("Flow index out of range!"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue