clippy: Fix needless_lifetimes warnings (#31933)

This commit is contained in:
Oluwatobi Sofela 2024-03-29 12:59:07 +01:00 committed by GitHub
parent a8976ff00a
commit 4a68243f65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 32 additions and 32 deletions

View file

@ -509,10 +509,10 @@ impl LayoutThread {
} }
/// Receives and dispatches messages from other threads. /// Receives and dispatches messages from other threads.
fn handle_request_helper<'a, 'b>( fn handle_request_helper(
&mut self, &mut self,
request: Msg, request: Msg,
possibly_locked_rw_data: &mut RwData<'a, 'b>, possibly_locked_rw_data: &mut RwData<'_, '_>,
) { ) {
match request { match request {
Msg::SetQuirksMode(mode) => self.handle_set_quirks_mode(mode), Msg::SetQuirksMode(mode) => self.handle_set_quirks_mode(mode),
@ -561,10 +561,10 @@ impl LayoutThread {
} }
} }
fn collect_reports<'a, 'b>( fn collect_reports(
&self, &self,
reports_chan: ReportsChan, reports_chan: ReportsChan,
possibly_locked_rw_data: &mut RwData<'a, 'b>, possibly_locked_rw_data: &mut RwData<'_, '_>,
) { ) {
let mut reports = vec![]; let mut reports = vec![];
// Servo uses vanilla jemalloc, which doesn't have a // Servo uses vanilla jemalloc, which doesn't have a
@ -873,10 +873,10 @@ impl LayoutThread {
} }
/// The high-level routine that performs layout. /// The high-level routine that performs layout.
fn handle_reflow<'a, 'b>( fn handle_reflow(
&mut self, &mut self,
data: &mut ScriptReflowResult, data: &mut ScriptReflowResult,
possibly_locked_rw_data: &mut RwData<'a, 'b>, possibly_locked_rw_data: &mut RwData<'_, '_>,
) { ) {
let document = unsafe { ServoLayoutNode::new(&data.document) }; let document = unsafe { ServoLayoutNode::new(&data.document) };
let document = document.as_document().unwrap(); let document = document.as_document().unwrap();
@ -1289,10 +1289,10 @@ impl LayoutThread {
); );
} }
fn set_scroll_states<'a, 'b>( fn set_scroll_states(
&mut self, &mut self,
new_scroll_states: Vec<ScrollState>, new_scroll_states: Vec<ScrollState>,
possibly_locked_rw_data: &mut RwData<'a, 'b>, possibly_locked_rw_data: &mut RwData<'_, '_>,
) { ) {
let mut rw_data = possibly_locked_rw_data.lock(); let mut rw_data = possibly_locked_rw_data.lock();
let mut script_scroll_states = vec![]; let mut script_scroll_states = vec![];

View file

@ -489,10 +489,10 @@ impl LayoutThread {
} }
/// Receives and dispatches messages from other threads. /// Receives and dispatches messages from other threads.
fn handle_request_helper<'a, 'b>( fn handle_request_helper(
&mut self, &mut self,
request: Msg, request: Msg,
possibly_locked_rw_data: &mut RwData<'a, 'b>, possibly_locked_rw_data: &mut RwData<'_, '_>,
) { ) {
match request { match request {
Msg::SetQuirksMode(mode) => self.handle_set_quirks_mode(mode), Msg::SetQuirksMode(mode) => self.handle_set_quirks_mode(mode),
@ -522,10 +522,10 @@ impl LayoutThread {
} }
} }
fn collect_reports<'a, 'b>( fn collect_reports(
&self, &self,
reports_chan: ReportsChan, reports_chan: ReportsChan,
possibly_locked_rw_data: &mut RwData<'a, 'b>, possibly_locked_rw_data: &mut RwData<'_, '_>,
) { ) {
let mut reports = vec![]; let mut reports = vec![];
// Servo uses vanilla jemalloc, which doesn't have a // Servo uses vanilla jemalloc, which doesn't have a
@ -590,10 +590,10 @@ impl LayoutThread {
} }
/// The high-level routine that performs layout. /// The high-level routine that performs layout.
fn handle_reflow<'a, 'b>( fn handle_reflow(
&mut self, &mut self,
data: &mut ScriptReflowResult, data: &mut ScriptReflowResult,
possibly_locked_rw_data: &mut RwData<'a, 'b>, possibly_locked_rw_data: &mut RwData<'_, '_>,
) { ) {
let document = unsafe { ServoLayoutNode::<DOMLayoutData>::new(&data.document) }; let document = unsafe { ServoLayoutNode::<DOMLayoutData>::new(&data.document) };
let document = document.as_document().unwrap(); let document = document.as_document().unwrap();
@ -976,10 +976,10 @@ impl LayoutThread {
); );
} }
fn set_scroll_states<'a, 'b>( fn set_scroll_states(
&mut self, &mut self,
new_scroll_states: Vec<ScrollState>, new_scroll_states: Vec<ScrollState>,
possibly_locked_rw_data: &mut RwData<'a, 'b>, possibly_locked_rw_data: &mut RwData<'_, '_>,
) { ) {
let mut rw_data = possibly_locked_rw_data.lock(); let mut rw_data = possibly_locked_rw_data.lock();
let mut script_scroll_states = vec![]; let mut script_scroll_states = vec![];

View file

@ -88,7 +88,7 @@ unsafe impl<T> StableTraceObject for Dom<T>
where where
T: DomObject, T: DomObject,
{ {
fn stable_trace_object<'a>(&'a self) -> *const dyn JSTraceable { fn stable_trace_object(&self) -> *const dyn JSTraceable {
// The JSTraceable impl for Reflector doesn't actually do anything, // The JSTraceable impl for Reflector doesn't actually do anything,
// so we need this shenanigan to actually trace the reflector of the // so we need this shenanigan to actually trace the reflector of the
// T pointer in Dom<T>. // T pointer in Dom<T>.
@ -107,7 +107,7 @@ unsafe impl<T> StableTraceObject for MaybeUnreflectedDom<T>
where where
T: DomObject, T: DomObject,
{ {
fn stable_trace_object<'a>(&'a self) -> *const dyn JSTraceable { fn stable_trace_object(&self) -> *const dyn JSTraceable {
// The JSTraceable impl for Reflector doesn't actually do anything, // The JSTraceable impl for Reflector doesn't actually do anything,
// so we need this shenanigan to actually trace the reflector of the // so we need this shenanigan to actually trace the reflector of the
// T pointer in Dom<T>. // T pointer in Dom<T>.

View file

@ -2645,7 +2645,7 @@ impl FormControl for HTMLInputElement {
self.form_owner.set(form); self.form_owner.set(form);
} }
fn to_element<'a>(&'a self) -> &'a Element { fn to_element(&self) -> &Element {
self.upcast::<Element>() self.upcast::<Element>()
} }
} }

View file

@ -190,7 +190,7 @@ impl FormControl for HTMLLabelElement {
// form owner. Therefore it doesn't hold form owner itself. // form owner. Therefore it doesn't hold form owner itself.
} }
fn to_element<'a>(&'a self) -> &'a Element { fn to_element(&self) -> &Element {
self.upcast::<Element>() self.upcast::<Element>()
} }
} }

View file

@ -103,7 +103,7 @@ impl FormControl for HTMLLegendElement {
self.form_owner.set(form); self.form_owner.set(form);
} }
fn to_element<'a>(&'a self) -> &'a Element { fn to_element(&self) -> &Element {
self.upcast::<Element>() self.upcast::<Element>()
} }
} }

View file

@ -175,7 +175,7 @@ impl FormControl for HTMLObjectElement {
self.form_owner.set(form); self.form_owner.set(form);
} }
fn to_element<'a>(&'a self) -> &'a Element { fn to_element(&self) -> &Element {
self.upcast::<Element>() self.upcast::<Element>()
} }
} }

View file

@ -152,7 +152,7 @@ impl HTMLOutputElementMethods for HTMLOutputElement {
} }
impl VirtualMethods for HTMLOutputElement { impl VirtualMethods for HTMLOutputElement {
fn super_type<'b>(&'b self) -> Option<&'b dyn VirtualMethods> { fn super_type(&self) -> Option<&dyn VirtualMethods> {
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods) Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
} }
@ -176,7 +176,7 @@ impl FormControl for HTMLOutputElement {
self.form_owner.set(form); self.form_owner.set(form);
} }
fn to_element<'a>(&'a self) -> &'a Element { fn to_element(&self) -> &Element {
self.upcast::<Element>() self.upcast::<Element>()
} }
} }

View file

@ -490,7 +490,7 @@ impl FormControl for HTMLSelectElement {
self.form_owner.set(form); self.form_owner.set(form);
} }
fn to_element<'a>(&'a self) -> &'a Element { fn to_element(&self) -> &Element {
self.upcast::<Element>() self.upcast::<Element>()
} }
} }

View file

@ -138,7 +138,7 @@ impl NodeList {
} }
} }
pub fn iter<'a>(&'a self) -> impl Iterator<Item = DomRoot<Node>> + 'a { pub fn iter(&self) -> impl Iterator<Item = DomRoot<Node>> + '_ {
let len = self.Length(); let len = self.Length();
// There is room for optimization here in non-simple cases, // There is room for optimization here in non-simple cases,
// as calling Item repeatedly on a live list can involve redundant work. // as calling Item repeatedly on a live list can involve redundant work.

View file

@ -87,7 +87,7 @@ where
T::name() T::name()
} }
fn as_any<'a>(&'a self) -> &'a dyn Any { fn as_any(&self) -> &dyn Any {
self self
} }
} }

View file

@ -1575,7 +1575,7 @@ impl WebGLRenderingContext {
constants::COLOR_ATTACHMENT0 <= attachment && attachment <= last_slot constants::COLOR_ATTACHMENT0 <= attachment && attachment <= last_slot
} }
pub fn compressed_tex_image_2d<'a>( pub fn compressed_tex_image_2d(
&self, &self,
target: u32, target: u32,
level: i32, level: i32,
@ -1583,7 +1583,7 @@ impl WebGLRenderingContext {
width: i32, width: i32,
height: i32, height: i32,
border: i32, border: i32,
data: &'a [u8], data: &[u8],
) { ) {
let validator = CompressedTexImage2DValidator::new( let validator = CompressedTexImage2DValidator::new(
self, self,
@ -1642,7 +1642,7 @@ impl WebGLRenderingContext {
} }
} }
pub fn compressed_tex_sub_image_2d<'a>( pub fn compressed_tex_sub_image_2d(
&self, &self,
target: u32, target: u32,
level: i32, level: i32,
@ -1651,7 +1651,7 @@ impl WebGLRenderingContext {
width: i32, width: i32,
height: i32, height: i32,
format: u32, format: u32,
data: &'a [u8], data: &[u8],
) { ) {
let validator = CompressedTexSubImage2DValidator::new( let validator = CompressedTexSubImage2DValidator::new(
self, self,

View file

@ -478,7 +478,7 @@ impl Documents {
.and_then(|doc| doc.find_iframe(browsing_context_id)) .and_then(|doc| doc.find_iframe(browsing_context_id))
} }
pub fn iter<'a>(&'a self) -> DocumentsIter<'a> { pub fn iter(&self) -> DocumentsIter<'_> {
DocumentsIter { DocumentsIter {
iter: self.map.iter(), iter: self.map.iter(),
} }