mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
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:
parent
92026cb094
commit
621ddd749c
57 changed files with 92 additions and 99 deletions
|
@ -315,7 +315,7 @@ impl Convert<LatencyCategory> for AudioContextLatencyCategory {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> Convert<RealTimeAudioContextOptions> for &'a AudioContextOptions {
|
||||
impl Convert<RealTimeAudioContextOptions> for &AudioContextOptions {
|
||||
fn convert(self) -> RealTimeAudioContextOptions {
|
||||
RealTimeAudioContextOptions {
|
||||
sample_rate: *self.sampleRate.unwrap_or(Finite::wrap(44100.)),
|
||||
|
|
|
@ -216,7 +216,7 @@ impl<T: DomObject> ThisReflector for T {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> ThisReflector for HandleObject<'a> {
|
||||
impl ThisReflector for HandleObject<'_> {
|
||||
fn jsobject(&self) -> *mut JSObject {
|
||||
self.get()
|
||||
}
|
||||
|
|
|
@ -260,7 +260,7 @@ impl<'a> ThreadLocalStackRoots<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> Drop for ThreadLocalStackRoots<'a> {
|
||||
impl Drop for ThreadLocalStackRoots<'_> {
|
||||
fn drop(&mut self) {
|
||||
STACK_ROOTS.with(|r| r.set(None));
|
||||
}
|
||||
|
@ -698,7 +698,7 @@ impl<T: DomObject> PartialEq for MutNullableDom<T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a, T: DomObject> PartialEq<Option<&'a T>> for MutNullableDom<T> {
|
||||
impl<T: DomObject> PartialEq<Option<&T>> for MutNullableDom<T> {
|
||||
fn eq(&self, other: &Option<&T>) -> bool {
|
||||
unsafe { *self.ptr.get() == other.map(Dom::from_ref) }
|
||||
}
|
||||
|
|
|
@ -356,7 +356,7 @@ impl From<String> for DOMString {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&'a str> for DOMString {
|
||||
impl From<&str> for DOMString {
|
||||
fn from(contents: &str) -> DOMString {
|
||||
DOMString::from(String::from(contents))
|
||||
}
|
||||
|
|
|
@ -187,7 +187,7 @@ impl BiquadFilterNodeMethods<crate::DomTypeHolder> for BiquadFilterNode {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> Convert<BiquadFilterNodeOptions> for &'a BiquadFilterOptions {
|
||||
impl Convert<BiquadFilterNodeOptions> for &BiquadFilterOptions {
|
||||
fn convert(self) -> BiquadFilterNodeOptions {
|
||||
BiquadFilterNodeOptions {
|
||||
gain: *self.gain,
|
||||
|
|
|
@ -75,7 +75,7 @@ pub trait ToFillOrStrokeStyle {
|
|||
fn to_fill_or_stroke_style(self) -> FillOrStrokeStyle;
|
||||
}
|
||||
|
||||
impl<'a> ToFillOrStrokeStyle for &'a CanvasGradient {
|
||||
impl ToFillOrStrokeStyle for &CanvasGradient {
|
||||
fn to_fill_or_stroke_style(self) -> FillOrStrokeStyle {
|
||||
let gradient_stops = self.stops.borrow().clone();
|
||||
match self.style {
|
||||
|
|
|
@ -70,7 +70,7 @@ impl CanvasPattern {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> ToFillOrStrokeStyle for &'a CanvasPattern {
|
||||
impl ToFillOrStrokeStyle for &CanvasPattern {
|
||||
fn to_fill_or_stroke_style(self) -> FillOrStrokeStyle {
|
||||
FillOrStrokeStyle::Surface(SurfaceStyle::new(
|
||||
self.surface_data.clone(),
|
||||
|
|
|
@ -83,7 +83,7 @@ impl<'a> AutoWorkerReset<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> Drop for AutoWorkerReset<'a> {
|
||||
impl Drop for AutoWorkerReset<'_> {
|
||||
fn drop(&mut self) {
|
||||
self.workerscope
|
||||
.worker
|
||||
|
|
|
@ -681,7 +681,7 @@ pub trait LayoutElementHelpers<'dom> {
|
|||
fn get_attr_vals_for_layout(self, name: &LocalName) -> Vec<&'dom AttrValue>;
|
||||
}
|
||||
|
||||
impl<'dom> LayoutDom<'dom, Element> {
|
||||
impl LayoutDom<'_, Element> {
|
||||
pub(super) fn focus_state(self) -> bool {
|
||||
self.unsafe_get().state.get().contains(ElementState::FOCUS)
|
||||
}
|
||||
|
@ -4361,7 +4361,7 @@ pub enum AttributeMutation<'a> {
|
|||
Removed,
|
||||
}
|
||||
|
||||
impl<'a> AttributeMutation<'a> {
|
||||
impl AttributeMutation<'_> {
|
||||
pub fn is_removal(&self) -> bool {
|
||||
match *self {
|
||||
AttributeMutation::Removed => true,
|
||||
|
|
|
@ -1383,7 +1383,7 @@ pub enum FormSubmitterElement<'a> {
|
|||
// (including custom elements) that can be passed as submitter.
|
||||
}
|
||||
|
||||
impl<'a> FormSubmitterElement<'a> {
|
||||
impl FormSubmitterElement<'_> {
|
||||
fn action(&self) -> DOMString {
|
||||
match *self {
|
||||
FormSubmitterElement::Form(form) => form.Action(),
|
||||
|
|
|
@ -195,7 +195,7 @@ impl InputType {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&'a Atom> for InputType {
|
||||
impl From<&Atom> for InputType {
|
||||
fn from(value: &Atom) -> InputType {
|
||||
match value.to_ascii_lowercase() {
|
||||
atom!("button") => InputType::Button,
|
||||
|
|
|
@ -73,7 +73,7 @@ trait ProcessDataURL {
|
|||
fn process_data_url(&self);
|
||||
}
|
||||
|
||||
impl<'a> ProcessDataURL for &'a HTMLObjectElement {
|
||||
impl ProcessDataURL for &HTMLObjectElement {
|
||||
// Makes the local `data` member match the status of the `data` attribute and starts
|
||||
/// prefetching the image. This method must be called after `data` is changed.
|
||||
fn process_data_url(&self) {
|
||||
|
|
|
@ -157,7 +157,7 @@ impl OscillatorNodeMethods<crate::DomTypeHolder> for OscillatorNode {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> Convert<ServoMediaOscillatorOptions> for &'a OscillatorOptions {
|
||||
impl Convert<ServoMediaOscillatorOptions> for &OscillatorOptions {
|
||||
fn convert(self) -> ServoMediaOscillatorOptions {
|
||||
ServoMediaOscillatorOptions {
|
||||
oscillator_type: self.type_.convert(),
|
||||
|
|
|
@ -373,7 +373,7 @@ impl PannerNodeMethods<crate::DomTypeHolder> for PannerNode {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> Convert<PannerNodeOptions> for &'a PannerOptions {
|
||||
impl Convert<PannerNodeOptions> for &PannerOptions {
|
||||
fn convert(self) -> PannerNodeOptions {
|
||||
PannerNodeOptions {
|
||||
panning_model: self.panningModel.convert(),
|
||||
|
|
|
@ -837,7 +837,7 @@ impl Convert<RTCSessionDescriptionInit> for SessionDescription {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> Convert<SessionDescription> for &'a RTCSessionDescriptionInit {
|
||||
impl Convert<SessionDescription> for &RTCSessionDescriptionInit {
|
||||
fn convert(self) -> SessionDescription {
|
||||
let type_ = match self.type_ {
|
||||
RTCSdpType::Answer => SdpType::Answer,
|
||||
|
|
|
@ -212,7 +212,7 @@ impl Iterator for SerializationIterator {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> Serialize for &'a Node {
|
||||
impl Serialize for &Node {
|
||||
fn serialize<S: Serializer>(
|
||||
&self,
|
||||
serializer: &mut S,
|
||||
|
|
|
@ -456,7 +456,7 @@ impl TreeWalker {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> Iterator for &'a TreeWalker {
|
||||
impl Iterator for &TreeWalker {
|
||||
type Item = DomRoot<Node>;
|
||||
|
||||
fn next(&mut self) -> Option<DomRoot<Node>> {
|
||||
|
|
|
@ -107,7 +107,7 @@ pub struct CommonTexImage2DValidatorResult {
|
|||
pub border: u32,
|
||||
}
|
||||
|
||||
impl<'a> WebGLValidator for CommonTexImage2DValidator<'a> {
|
||||
impl WebGLValidator for CommonTexImage2DValidator<'_> {
|
||||
type Error = TexImageValidationError;
|
||||
type ValidatedOutput = CommonTexImage2DValidatorResult;
|
||||
fn validate(self) -> Result<Self::ValidatedOutput, TexImageValidationError> {
|
||||
|
@ -299,7 +299,7 @@ pub struct TexImage2DValidatorResult {
|
|||
|
||||
/// TexImage2d validator as per
|
||||
/// <https://www.khronos.org/opengles/sdk/docs/man/xhtml/glTexImage2D.xml>
|
||||
impl<'a> WebGLValidator for TexImage2DValidator<'a> {
|
||||
impl WebGLValidator for TexImage2DValidator<'_> {
|
||||
type ValidatedOutput = TexImage2DValidatorResult;
|
||||
type Error = TexImageValidationError;
|
||||
|
||||
|
@ -459,7 +459,7 @@ fn is_subimage_blockaligned(
|
|||
(height % block_height == 0 || yoffset + height == tex_info.height())
|
||||
}
|
||||
|
||||
impl<'a> WebGLValidator for CommonCompressedTexImage2DValidator<'a> {
|
||||
impl WebGLValidator for CommonCompressedTexImage2DValidator<'_> {
|
||||
type Error = TexImageValidationError;
|
||||
type ValidatedOutput = CommonCompressedTexImage2DValidatorResult;
|
||||
|
||||
|
@ -537,7 +537,7 @@ impl<'a> CompressedTexImage2DValidator<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> WebGLValidator for CompressedTexImage2DValidator<'a> {
|
||||
impl WebGLValidator for CompressedTexImage2DValidator<'_> {
|
||||
type Error = TexImageValidationError;
|
||||
type ValidatedOutput = CommonCompressedTexImage2DValidatorResult;
|
||||
|
||||
|
@ -617,7 +617,7 @@ impl<'a> CompressedTexSubImage2DValidator<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> WebGLValidator for CompressedTexSubImage2DValidator<'a> {
|
||||
impl WebGLValidator for CompressedTexSubImage2DValidator<'_> {
|
||||
type Error = TexImageValidationError;
|
||||
type ValidatedOutput = CommonCompressedTexImage2DValidatorResult;
|
||||
|
||||
|
@ -728,7 +728,7 @@ impl<'a> TexStorageValidator<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> WebGLValidator for TexStorageValidator<'a> {
|
||||
impl WebGLValidator for TexStorageValidator<'_> {
|
||||
type Error = TexImageValidationError;
|
||||
type ValidatedOutput = TexStorageValidatorResult;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue