Elide lifetimes where possible after rustup (#34824)

The new version of rust allows us to elide some lifetimes and clippy is
now complaining about this. This change elides them where possible and
removes the clippy exceptions.

Fixes #34804.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Martin Robinson 2025-01-03 19:54:44 +01:00 committed by GitHub
parent 92026cb094
commit 621ddd749c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
57 changed files with 92 additions and 99 deletions

View file

@ -136,7 +136,7 @@ struct PathBuilderRef<'a> {
transform: Transform2D<f32>,
}
impl<'a> PathBuilderRef<'a> {
impl PathBuilderRef<'_> {
fn line_to(&mut self, pt: &Point2D<f32>) {
let pt = self.transform.transform_point(*pt);
self.builder.line_to(pt);
@ -238,7 +238,7 @@ struct UnshapedTextRun<'a> {
string: &'a str,
}
impl<'a> UnshapedTextRun<'a> {
impl UnshapedTextRun<'_> {
fn script_and_font_compatible(&self, script: Script, other_font: &Option<FontRef>) -> bool {
if self.script != script {
return false;
@ -1417,7 +1417,7 @@ impl<'a> CanvasData<'a> {
}
}
impl<'a> Drop for CanvasData<'a> {
impl Drop for CanvasData<'_> {
fn drop(&mut self) {
let mut updates = vec![];
if let Some(image_key) = self.old_image_key.take() {

View file

@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
#![deny(unsafe_code)]
#![allow(clippy::needless_lifetimes)]
mod raqote_backend;

View file

@ -118,7 +118,7 @@ pub enum Pattern<'a> {
Surface(SurfacePattern<'a>),
}
impl<'a> Pattern<'a> {
impl Pattern<'_> {
fn set_transform(&mut self, transform: Transform2D<f32>) {
match self {
Pattern::Surface(pattern) => pattern.set_transform(transform),

View file

@ -233,7 +233,7 @@ macro_rules! create_fun {
};
}
impl<'a> GLExt for &'a Gl {
impl GLExt for &Gl {
create_fun!(
try_get_integer,
get_integer,

View file

@ -310,7 +310,7 @@ pub(crate) struct WebXRBridgeContexts<'a> {
pub(crate) bound_context_id: &'a mut Option<WebGLContextId>,
}
impl<'a> WebXRContexts<WebXRSurfman> for WebXRBridgeContexts<'a> {
impl WebXRContexts<WebXRSurfman> for WebXRBridgeContexts<'_> {
fn context(&mut self, device: &Device, context_id: WebXRContextId) -> Option<&mut Context> {
let data = WebGLThread::make_current_if_needed_mut(
device,