diff --git a/components/config_plugins/parse.rs b/components/config_plugins/parse.rs index 715b60f50e9..5d9d9fe1dc4 100644 --- a/components/config_plugins/parse.rs +++ b/components/config_plugins/parse.rs @@ -54,7 +54,7 @@ pub struct RootTypeDef { } impl Parse for MacroInput { - fn parse(input: ParseStream) -> Result { + fn parse(input: ParseStream<'_>) -> Result { let fields: Punctuated = input.parse_terminated(MacroArg::parse)?; let mut gen_accessors = None; let mut type_def = None; @@ -83,7 +83,7 @@ impl Parse for MacroInput { } impl Parse for MacroArg { - fn parse(input: ParseStream) -> Result { + fn parse(input: ParseStream<'_>) -> Result { let lookahead = input.lookahead1(); if lookahead.peek(kw::gen_types) { Ok(MacroArg::Types(input.parse()?)) @@ -98,7 +98,7 @@ impl Parse for MacroArg { } impl Parse for ArgInner { - fn parse(input: ParseStream) -> Result { + fn parse(input: ParseStream<'_>) -> Result { Ok(ArgInner { _field_kw: input.parse()?, _equals: input.parse()?, @@ -108,7 +108,7 @@ impl Parse for ArgInner { } impl Parse for Field { - fn parse(input: ParseStream) -> Result { + fn parse(input: ParseStream<'_>) -> Result { Ok(Field { attributes: input.call(Attribute::parse_outer)?, name: input.parse()?, @@ -119,7 +119,7 @@ impl Parse for Field { } impl Parse for RootTypeDef { - fn parse(input: ParseStream) -> Result { + fn parse(input: ParseStream<'_>) -> Result { Ok(RootTypeDef { type_name: input.parse()?, type_def: input.parse()?, @@ -128,7 +128,7 @@ impl Parse for RootTypeDef { } impl Parse for NewTypeDef { - fn parse(input: ParseStream) -> Result { + fn parse(input: ParseStream<'_>) -> Result { let content; #[allow(clippy::eval_order_dependence)] Ok(NewTypeDef { @@ -139,7 +139,7 @@ impl Parse for NewTypeDef { } impl Parse for FieldType { - fn parse(input: ParseStream) -> Result { + fn parse(input: ParseStream<'_>) -> Result { if input.peek(token::Brace) { Ok(FieldType::NewTypeDef(input.parse()?)) } else { diff --git a/components/hashglobe/src/fake.rs b/components/hashglobe/src/fake.rs index 339c54a4991..d544721a1a2 100644 --- a/components/hashglobe/src/fake.rs +++ b/components/hashglobe/src/fake.rs @@ -75,7 +75,7 @@ where Ok(self.shrink_to_fit()) } - pub fn try_entry(&mut self, key: K) -> Result, FailedAllocationError> { + pub fn try_entry(&mut self, key: K) -> Result, FailedAllocationError> { Ok(self.entry(key)) } @@ -159,7 +159,7 @@ where V: fmt::Debug, S: BuildHasher, { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.0.fmt(f) } } @@ -220,7 +220,7 @@ where T: Eq + Hash + fmt::Debug, S: BuildHasher, { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.0.fmt(f) } } diff --git a/components/hashglobe/src/hash_map.rs b/components/hashglobe/src/hash_map.rs index 33a0d7d5019..e122a82aabb 100644 --- a/components/hashglobe/src/hash_map.rs +++ b/components/hashglobe/src/hash_map.rs @@ -452,7 +452,7 @@ where } } -fn pop_internal(starting_bucket: FullBucketMut) -> (K, V, &mut RawTable) { +fn pop_internal(starting_bucket: FullBucketMut<'_, K, V>) -> (K, V, &mut RawTable) { let (empty, retkey, retval) = starting_bucket.take(); let mut gap = match empty.gap_peek() { Ok(b) => b, @@ -856,7 +856,7 @@ where /// println!("{}", key); /// } /// ``` - pub fn keys(&self) -> Keys { + pub fn keys(&self) -> Keys<'_, K, V> { Keys { inner: self.iter() } } @@ -877,7 +877,7 @@ where /// println!("{}", val); /// } /// ``` - pub fn values(&self) -> Values { + pub fn values(&self) -> Values<'_, K, V> { Values { inner: self.iter() } } @@ -903,7 +903,7 @@ where /// println!("{}", val); /// } /// ``` - pub fn values_mut(&mut self) -> ValuesMut { + pub fn values_mut(&mut self) -> ValuesMut<'_, K, V> { ValuesMut { inner: self.iter_mut(), } @@ -926,7 +926,7 @@ where /// println!("key: {} val: {}", key, val); /// } /// ``` - pub fn iter(&self) -> Iter { + pub fn iter(&self) -> Iter<'_, K, V> { Iter { inner: self.table.iter(), } @@ -955,7 +955,7 @@ where /// println!("key: {} val: {}", key, val); /// } /// ``` - pub fn iter_mut(&mut self) -> IterMut { + pub fn iter_mut(&mut self) -> IterMut<'_, K, V> { IterMut { inner: self.table.iter_mut(), } @@ -980,12 +980,12 @@ where /// assert_eq!(letters[&'u'], 1); /// assert_eq!(letters.get(&'y'), None); /// ``` - pub fn entry(&mut self, key: K) -> Entry { + pub fn entry(&mut self, key: K) -> Entry<'_, K, V> { self.try_entry(key).unwrap() } #[inline(always)] - pub fn try_entry(&mut self, key: K) -> Result, FailedAllocationError> { + pub fn try_entry(&mut self, key: K) -> Result, FailedAllocationError> { // Gotta resize now. self.try_reserve(1)?; let hash = self.make_hash(&key); @@ -1047,7 +1047,7 @@ where /// assert!(a.is_empty()); /// ``` #[inline] - pub fn drain(&mut self) -> Drain + pub fn drain(&mut self) -> Drain<'_, K, V> where K: 'static, V: 'static, @@ -1314,7 +1314,7 @@ where V: Debug, S: BuildHasher, { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_map().entries(self.iter()).finish() } } @@ -1351,7 +1351,7 @@ where /// /// [`iter`]: struct.HashMap.html#method.iter /// [`HashMap`]: struct.HashMap.html -pub struct Iter<'a, K: 'a, V: 'a> { +pub struct Iter<'a, K, V> { inner: table::Iter<'a, K, V>, } @@ -1365,7 +1365,7 @@ impl<'a, K, V> Clone for Iter<'a, K, V> { } impl<'a, K: Debug, V: Debug> fmt::Debug for Iter<'a, K, V> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_list().entries(self.clone()).finish() } } @@ -1377,7 +1377,7 @@ impl<'a, K: Debug, V: Debug> fmt::Debug for Iter<'a, K, V> { /// /// [`iter_mut`]: struct.HashMap.html#method.iter_mut /// [`HashMap`]: struct.HashMap.html -pub struct IterMut<'a, K: 'a, V: 'a> { +pub struct IterMut<'a, K, V> { inner: table::IterMut<'a, K, V>, } @@ -1399,7 +1399,7 @@ pub struct IntoIter { /// /// [`keys`]: struct.HashMap.html#method.keys /// [`HashMap`]: struct.HashMap.html -pub struct Keys<'a, K: 'a, V: 'a> { +pub struct Keys<'a, K, V> { inner: Iter<'a, K, V>, } @@ -1413,7 +1413,7 @@ impl<'a, K, V> Clone for Keys<'a, K, V> { } impl<'a, K: Debug, V> fmt::Debug for Keys<'a, K, V> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_list().entries(self.clone()).finish() } } @@ -1425,7 +1425,7 @@ impl<'a, K: Debug, V> fmt::Debug for Keys<'a, K, V> { /// /// [`values`]: struct.HashMap.html#method.values /// [`HashMap`]: struct.HashMap.html -pub struct Values<'a, K: 'a, V: 'a> { +pub struct Values<'a, K, V> { inner: Iter<'a, K, V>, } @@ -1439,7 +1439,7 @@ impl<'a, K, V> Clone for Values<'a, K, V> { } impl<'a, K, V: Debug> fmt::Debug for Values<'a, K, V> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_list().entries(self.clone()).finish() } } @@ -1462,7 +1462,7 @@ pub struct Drain<'a, K: 'static, V: 'static> { /// /// [`values_mut`]: struct.HashMap.html#method.values_mut /// [`HashMap`]: struct.HashMap.html -pub struct ValuesMut<'a, K: 'a, V: 'a> { +pub struct ValuesMut<'a, K, V> { inner: IterMut<'a, K, V>, } @@ -1507,7 +1507,7 @@ impl<'a, K, V> InternalEntry> { /// /// [`HashMap`]: struct.HashMap.html /// [`entry`]: struct.HashMap.html#method.entry -pub enum Entry<'a, K: 'a, V: 'a> { +pub enum Entry<'a, K, V> { /// An occupied entry. Occupied(OccupiedEntry<'a, K, V>), @@ -1516,7 +1516,7 @@ pub enum Entry<'a, K: 'a, V: 'a> { } impl<'a, K: 'a + Debug, V: 'a + Debug> Debug for Entry<'a, K, V> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match *self { Vacant(ref v) => f.debug_tuple("Entry").field(v).finish(), Occupied(ref o) => f.debug_tuple("Entry").field(o).finish(), @@ -1528,13 +1528,13 @@ impl<'a, K: 'a + Debug, V: 'a + Debug> Debug for Entry<'a, K, V> { /// It is part of the [`Entry`] enum. /// /// [`Entry`]: enum.Entry.html -pub struct OccupiedEntry<'a, K: 'a, V: 'a> { +pub struct OccupiedEntry<'a, K, V> { key: Option, elem: FullBucket>, } impl<'a, K: 'a + Debug, V: 'a + Debug> Debug for OccupiedEntry<'a, K, V> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("OccupiedEntry") .field("key", self.key()) .field("value", self.get()) @@ -1546,14 +1546,14 @@ impl<'a, K: 'a + Debug, V: 'a + Debug> Debug for OccupiedEntry<'a, K, V> { /// It is part of the [`Entry`] enum. /// /// [`Entry`]: enum.Entry.html -pub struct VacantEntry<'a, K: 'a, V: 'a> { +pub struct VacantEntry<'a, K, V> { hash: SafeHash, key: K, elem: VacantEntryState>, } impl<'a, K: 'a + Debug, V: 'a> Debug for VacantEntry<'a, K, V> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_tuple("VacantEntry").field(self.key()).finish() } } @@ -1668,7 +1668,7 @@ where K: fmt::Debug, V: fmt::Debug, { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_list().entries(self.inner.iter()).finish() } } @@ -1693,7 +1693,7 @@ impl ExactSizeIterator for IntoIter { } impl fmt::Debug for IntoIter { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_list().entries(self.inner.iter()).finish() } } @@ -1759,7 +1759,7 @@ where K: fmt::Debug, V: fmt::Debug, { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_list().entries(self.inner.inner.iter()).finish() } } @@ -1788,7 +1788,7 @@ where K: fmt::Debug, V: fmt::Debug, { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_list().entries(self.inner.iter()).finish() } } diff --git a/components/hashglobe/src/hash_set.rs b/components/hashglobe/src/hash_set.rs index d81eeda7d53..e5fca180c77 100644 --- a/components/hashglobe/src/hash_set.rs +++ b/components/hashglobe/src/hash_set.rs @@ -271,7 +271,7 @@ where /// println!("{}", x); /// } /// ``` - pub fn iter(&self) -> Iter { + pub fn iter(&self) -> Iter<'_, T> { Iter { iter: self.map.keys(), } @@ -436,7 +436,7 @@ where /// assert!(set.is_empty()); /// ``` #[inline] - pub fn drain(&mut self) -> Drain { + pub fn drain(&mut self) -> Drain<'_, T> { Drain { iter: self.map.drain(), } @@ -696,7 +696,7 @@ where T: Eq + Hash + fmt::Debug, S: BuildHasher, { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_set().entries(self.iter()).finish() } } @@ -881,7 +881,7 @@ where /// /// [`HashSet`]: struct.HashSet.html /// [`iter`]: struct.HashSet.html#method.iter -pub struct Iter<'a, K: 'a> { +pub struct Iter<'a, K> { iter: Keys<'a, K, ()>, } @@ -914,7 +914,7 @@ pub struct Drain<'a, K: 'static> { /// /// [`HashSet`]: struct.HashSet.html /// [`intersection`]: struct.HashSet.html#method.intersection -pub struct Intersection<'a, T: 'a, S: 'a> { +pub struct Intersection<'a, T, S> { // iterator of the first set iter: Iter<'a, T>, // the second set @@ -928,7 +928,7 @@ pub struct Intersection<'a, T: 'a, S: 'a> { /// /// [`HashSet`]: struct.HashSet.html /// [`difference`]: struct.HashSet.html#method.difference -pub struct Difference<'a, T: 'a, S: 'a> { +pub struct Difference<'a, T, S> { // iterator of the first set iter: Iter<'a, T>, // the second set @@ -942,7 +942,7 @@ pub struct Difference<'a, T: 'a, S: 'a> { /// /// [`HashSet`]: struct.HashSet.html /// [`symmetric_difference`]: struct.HashSet.html#method.symmetric_difference -pub struct SymmetricDifference<'a, T: 'a, S: 'a> { +pub struct SymmetricDifference<'a, T, S> { iter: Chain, Difference<'a, T, S>>, } @@ -953,7 +953,7 @@ pub struct SymmetricDifference<'a, T: 'a, S: 'a> { /// /// [`HashSet`]: struct.HashSet.html /// [`union`]: struct.HashSet.html#method.union -pub struct Union<'a, T: 'a, S: 'a> { +pub struct Union<'a, T, S> { iter: Chain, Difference<'a, T, S>>, } @@ -1029,7 +1029,7 @@ impl<'a, K> ExactSizeIterator for Iter<'a, K> { } impl<'a, K: fmt::Debug> fmt::Debug for Iter<'a, K> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_list().entries(self.clone()).finish() } } @@ -1051,7 +1051,7 @@ impl ExactSizeIterator for IntoIter { } impl fmt::Debug for IntoIter { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let entries_iter = self.iter.inner.iter().map(|(k, _)| k); f.debug_list().entries(entries_iter).finish() } @@ -1074,7 +1074,7 @@ impl<'a, K> ExactSizeIterator for Drain<'a, K> { } impl<'a, K: fmt::Debug> fmt::Debug for Drain<'a, K> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let entries_iter = self.iter.inner.iter().map(|(k, _)| k); f.debug_list().entries(entries_iter).finish() } @@ -1116,7 +1116,7 @@ where T: fmt::Debug + Eq + Hash, S: BuildHasher, { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_list().entries(self.clone()).finish() } } @@ -1157,7 +1157,7 @@ where T: fmt::Debug + Eq + Hash, S: BuildHasher, { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_list().entries(self.clone()).finish() } } @@ -1190,7 +1190,7 @@ where T: fmt::Debug + Eq + Hash, S: BuildHasher, { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_list().entries(self.clone()).finish() } } @@ -1208,7 +1208,7 @@ where T: fmt::Debug + Eq + Hash, S: BuildHasher, { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_list().entries(self.clone()).finish() } } diff --git a/components/hashglobe/src/lib.rs b/components/hashglobe/src/lib.rs index cf6e9710f5f..865a4dab113 100644 --- a/components/hashglobe/src/lib.rs +++ b/components/hashglobe/src/lib.rs @@ -58,7 +58,7 @@ impl error::Error for FailedAllocationError { } impl fmt::Display for FailedAllocationError { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self.allocation_info { Some(ref info) => write!( f, diff --git a/components/hashglobe/src/table.rs b/components/hashglobe/src/table.rs index 98f6da2a700..06c87e863dc 100644 --- a/components/hashglobe/src/table.rs +++ b/components/hashglobe/src/table.rs @@ -853,7 +853,7 @@ impl RawTable { self.size } - fn raw_buckets(&self) -> RawBuckets { + fn raw_buckets(&self) -> RawBuckets<'_, K, V> { RawBuckets { raw: self.raw_bucket_at(0), elems_left: self.size, @@ -861,13 +861,13 @@ impl RawTable { } } - pub fn iter(&self) -> Iter { + pub fn iter(&self) -> Iter<'_, K, V> { Iter { iter: self.raw_buckets(), } } - pub fn iter_mut(&mut self) -> IterMut { + pub fn iter_mut(&mut self) -> IterMut<'_, K, V> { IterMut { iter: self.raw_buckets(), _marker: marker::PhantomData, @@ -889,7 +889,7 @@ impl RawTable { } } - pub fn drain(&mut self) -> Drain { + pub fn drain(&mut self) -> Drain<'_, K, V> { let RawBuckets { raw, elems_left, .. } = self.raw_buckets(); @@ -1008,7 +1008,7 @@ impl<'a, K, V> Clone for Iter<'a, K, V> { } /// Iterator over mutable references to entries in a table. -pub struct IterMut<'a, K: 'a, V: 'a> { +pub struct IterMut<'a, K: 'a, V> { iter: RawBuckets<'a, K, V>, // To ensure invariance with respect to V _marker: marker::PhantomData<&'a mut V>, @@ -1020,7 +1020,7 @@ unsafe impl<'a, K: Sync, V: Sync> Sync for IterMut<'a, K, V> {} unsafe impl<'a, K: Send, V: Send> Send for IterMut<'a, K, V> {} impl<'a, K: 'a, V: 'a> IterMut<'a, K, V> { - pub fn iter(&self) -> Iter { + pub fn iter(&self) -> Iter<'_, K, V> { Iter { iter: self.iter.clone(), } @@ -1037,7 +1037,7 @@ unsafe impl Sync for IntoIter {} unsafe impl Send for IntoIter {} impl IntoIter { - pub fn iter(&self) -> Iter { + pub fn iter(&self) -> Iter<'_, K, V> { Iter { iter: self.iter.clone(), } @@ -1055,7 +1055,7 @@ unsafe impl<'a, K: Sync, V: Sync> Sync for Drain<'a, K, V> {} unsafe impl<'a, K: Send, V: Send> Send for Drain<'a, K, V> {} impl<'a, K, V> Drain<'a, K, V> { - pub fn iter(&self) -> Iter { + pub fn iter(&self) -> Iter<'_, K, V> { Iter { iter: self.iter.clone(), } diff --git a/ports/winit/app.rs b/ports/winit/app.rs index 6e7deb18e8b..d22edee25aa 100644 --- a/ports/winit/app.rs +++ b/ports/winit/app.rs @@ -142,7 +142,7 @@ impl App { } // This function decides whether the event should be handled during `run_forever`. - fn winit_event_to_servo_event(&self, event: winit::event::Event) { + fn winit_event_to_servo_event(&self, event: winit::event::Event<'_, ServoEvent>) { match event { // App level events winit::event::Event::Suspended => { diff --git a/ports/winit/backtrace.rs b/ports/winit/backtrace.rs index 06c400267fa..fff4db5b103 100644 --- a/ports/winit/backtrace.rs +++ b/ports/winit/backtrace.rs @@ -28,7 +28,7 @@ struct Print { } impl fmt::Debug for Print { - fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { // Safety: we’re in a signal handler that is about to call `libc::_exit`. // Potential data races from using `*_unsynchronized` functions are perhaps // less bad than potential deadlocks? @@ -78,7 +78,7 @@ impl fmt::Debug for Print { } } -fn print_path(fmt: &mut fmt::Formatter, path: BytesOrWideString) -> fmt::Result { +fn print_path(fmt: &mut fmt::Formatter<'_>, path: BytesOrWideString<'_>) -> fmt::Result { match path { BytesOrWideString::Bytes(mut bytes) => loop { match std::str::from_utf8(bytes) { diff --git a/ports/winit/events_loop.rs b/ports/winit/events_loop.rs index 2448e91e584..6275ffee183 100644 --- a/ports/winit/events_loop.rs +++ b/ports/winit/events_loop.rs @@ -82,7 +82,7 @@ impl EventsLoop { pub fn run_forever(self, mut callback: F) where F: FnMut( - winit::event::Event, + winit::event::Event<'_, ServoEvent>, Option<&winit::event_loop::EventLoopWindowTarget>, &mut winit::event_loop::ControlFlow ) { diff --git a/ports/winit/headed_window.rs b/ports/winit/headed_window.rs index c12eb5b5e99..318f2083828 100644 --- a/ports/winit/headed_window.rs +++ b/ports/winit/headed_window.rs @@ -394,7 +394,7 @@ impl WindowPortsMethods for Window { self.winit_window.id() } - fn winit_event_to_servo_event(&self, event: winit::event::WindowEvent) { + fn winit_event_to_servo_event(&self, event: winit::event::WindowEvent<'_>) { match event { winit::event::WindowEvent::ReceivedCharacter(ch) => self.handle_received_character(ch), winit::event::WindowEvent::KeyboardInput { input, .. } => self.handle_keyboard_input(input), diff --git a/ports/winit/headless_window.rs b/ports/winit/headless_window.rs index 49b23072257..7402a5c5221 100644 --- a/ports/winit/headless_window.rs +++ b/ports/winit/headless_window.rs @@ -98,7 +98,7 @@ impl WindowPortsMethods for Window { self.animation_state.get() == AnimationState::Animating } - fn winit_event_to_servo_event(&self, _event: winit::event::WindowEvent) { + fn winit_event_to_servo_event(&self, _event: winit::event::WindowEvent<'_>) { // Not expecting any winit events. } diff --git a/ports/winit/window_trait.rs b/ports/winit/window_trait.rs index e02f7dfba60..d44c853e0d3 100644 --- a/ports/winit/window_trait.rs +++ b/ports/winit/window_trait.rs @@ -20,7 +20,7 @@ pub trait WindowPortsMethods: WindowMethods { fn has_events(&self) -> bool; fn page_height(&self) -> f32; fn get_fullscreen(&self) -> bool; - fn winit_event_to_servo_event(&self, event: winit::event::WindowEvent); + fn winit_event_to_servo_event(&self, event: winit::event::WindowEvent<'_>); fn is_animating(&self) -> bool; fn set_title(&self, _title: &str) {} fn set_inner_size(&self, _size: DeviceIntSize) {}