From 02a70edf996a02b0ff2f7027fbc44320dd2f6e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Sun, 20 Jul 2025 11:06:18 +0200 Subject: [PATCH] Fix 'elided lifetime' warning from nightly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nightly 1.90. The fix passes on stable 1.88. Signed-off-by: Maxime “pep” Buquet --- minidom/CHANGELOG.md | 2 ++ minidom/src/element.rs | 20 ++++++++++---------- tokio-xmpp/ChangeLog | 1 + tokio-xmpp/src/stanzastream/worker.rs | 2 +- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/minidom/CHANGELOG.md b/minidom/CHANGELOG.md index 95cc39088b7ac65fa69f9cddaa44658c15a94b16..d8c2ce88bd345560230e642ad5cc6dcd4e21e073 100644 --- a/minidom/CHANGELOG.md +++ b/minidom/CHANGELOG.md @@ -2,6 +2,8 @@ Version NEXT: * Changes * Almost make the whole crate `no_std`, only `std::io` is still remaining. * Update rxml dependency to 0.13. + * Fixes + * Remove warnings for elided lifetimes (rustc 1.90) Version 0.16, released 2024-07-23: * Breaking diff --git a/minidom/src/element.rs b/minidom/src/element.rs index 4b80a9b63717a9051d47bfdfe815c5fde876fb9b..57fcc021b7e237fb55967ca1fc81779fa36758e8 100644 --- a/minidom/src/element.rs +++ b/minidom/src/element.rs @@ -74,7 +74,7 @@ pub type ItemWriter = CustomItemWriter; /// xml special characters (<, >, &, ', ") with their corresponding /// xml escaped value. #[must_use] -pub fn escape(raw: &[u8]) -> Cow<[u8]> { +pub fn escape(raw: &[u8]) -> Cow<'_, [u8]> { fn to_escape(b: u8) -> bool { matches!(b, b'<' | b'>' | b'\'' | b'&' | b'"') } @@ -264,7 +264,7 @@ impl Element { /// assert_eq!(iter.next(), None); /// ``` #[must_use] - pub fn attrs(&self) -> Attrs { + pub fn attrs(&self) -> Attrs<'_> { Attrs { iter: self.attributes.iter(), } @@ -273,7 +273,7 @@ impl Element { /// Returns an iterator over the attributes of this element, with the value being a mutable /// reference. #[must_use] - pub fn attrs_mut(&mut self) -> AttrsMut { + pub fn attrs_mut(&mut self) -> AttrsMut<'_> { AttrsMut { iter: self.attributes.iter_mut(), } @@ -457,13 +457,13 @@ impl Element { /// assert_eq!(iter.next(), None); /// ``` #[inline] - pub fn nodes(&self) -> Nodes { + pub fn nodes(&self) -> Nodes<'_> { self.children.iter() } /// Returns an iterator over mutable references to every child node of this element. #[inline] - pub fn nodes_mut(&mut self) -> NodesMut { + pub fn nodes_mut(&mut self) -> NodesMut<'_> { self.children.iter_mut() } @@ -484,7 +484,7 @@ impl Element { /// ``` #[inline] #[must_use] - pub fn children(&self) -> Children { + pub fn children(&self) -> Children<'_> { Children { iter: self.children.iter(), } @@ -493,7 +493,7 @@ impl Element { /// Returns an iterator over mutable references to every child element of this element. #[inline] #[must_use] - pub fn children_mut(&mut self) -> ChildrenMut { + pub fn children_mut(&mut self) -> ChildrenMut<'_> { ChildrenMut { iter: self.children.iter_mut(), } @@ -509,7 +509,7 @@ impl Element { /// remove text nodes. #[inline] #[doc(hidden)] - pub fn take_contents_as_children(&mut self) -> ContentsAsChildren { + pub fn take_contents_as_children(&mut self) -> ContentsAsChildren<'_> { ContentsAsChildren { iter: self.children.drain(..), } @@ -531,7 +531,7 @@ impl Element { /// ``` #[inline] #[must_use] - pub fn texts(&self) -> Texts { + pub fn texts(&self) -> Texts<'_> { Texts { iter: self.children.iter(), } @@ -540,7 +540,7 @@ impl Element { /// Returns an iterator over mutable references to every text node of this element. #[inline] #[must_use] - pub fn texts_mut(&mut self) -> TextsMut { + pub fn texts_mut(&mut self) -> TextsMut<'_> { TextsMut { iter: self.children.iter_mut(), } diff --git a/tokio-xmpp/ChangeLog b/tokio-xmpp/ChangeLog index 0f975aa327a69942d81875fdf4192841a32b6c3e..bf6d77c6c1cf657b3b07e1cc6f8f0e78e6f85632 100644 --- a/tokio-xmpp/ChangeLog +++ b/tokio-xmpp/ChangeLog @@ -47,6 +47,7 @@ XXXX-YY-ZZ RELEASER on the `tls-rust-ktls` feature. (!458, !490) - Building with insecure-tcp and no other feature got fixed. - Update rxml dependency to 0.13. + - Remove warnings for elided lifetimes (rustc 1.90) Version 4.0.0: 2024-07-26 Maxime “pep” Buquet diff --git a/tokio-xmpp/src/stanzastream/worker.rs b/tokio-xmpp/src/stanzastream/worker.rs index 08d1838d80e62088832fb991ac8eb760cf3f3987..bc5559e8572522432f96667666c6ac741ff556ea 100644 --- a/tokio-xmpp/src/stanzastream/worker.rs +++ b/tokio-xmpp/src/stanzastream/worker.rs @@ -334,7 +334,7 @@ impl WorkerStream { } } - fn close(&mut self) -> Close { + fn close(&mut self) -> Close<'_> { Close { stream: Pin::new(self), }