Skip to content

Commit 155471c

Browse files
committed
elide explicit lifetimes to make clippy happy
1 parent 17e0264 commit 155471c

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

data-url/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ impl<'a> DataUrl<'a> {
124124
/// The URL’s fragment identifier (after `#`)
125125
pub struct FragmentIdentifier<'a>(&'a str);
126126

127-
impl<'a> FragmentIdentifier<'a> {
127+
impl FragmentIdentifier<'_> {
128128
/// Like in a parsed URL
129129
pub fn to_percent_encoded(&self) -> String {
130130
let mut string = String::new();

form_urlencoded/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ pub struct ParseIntoOwned<'a> {
104104
inner: Parse<'a>,
105105
}
106106

107-
impl<'a> Iterator for ParseIntoOwned<'a> {
107+
impl Iterator for ParseIntoOwned<'_> {
108108
type Item = (String, String);
109109

110110
fn next(&mut self) -> Option<Self::Item> {
@@ -195,7 +195,7 @@ impl Target for String {
195195
type Finished = Self;
196196
}
197197

198-
impl<'a> Target for &'a mut String {
198+
impl Target for &mut String {
199199
fn as_mut_string(&mut self) -> &mut String {
200200
self
201201
}

idna/src/punycode.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ where
277277
phantom: PhantomData<C>,
278278
}
279279

280-
impl<'a, T: PunycodeCodeUnit + Copy, C: PunycodeCaller> Iterator for Decode<'a, T, C> {
280+
impl<T: PunycodeCodeUnit + Copy, C: PunycodeCaller> Iterator for Decode<'_, T, C> {
281281
type Item = char;
282282

283283
fn next(&mut self) -> Option<Self::Item> {
@@ -309,7 +309,7 @@ impl<'a, T: PunycodeCodeUnit + Copy, C: PunycodeCaller> Iterator for Decode<'a,
309309
}
310310
}
311311

312-
impl<'a, T: PunycodeCodeUnit + Copy, C: PunycodeCaller> ExactSizeIterator for Decode<'a, T, C> {
312+
impl<T: PunycodeCodeUnit + Copy, C: PunycodeCaller> ExactSizeIterator for Decode<'_, T, C> {
313313
fn len(&self) -> usize {
314314
self.len - self.position
315315
}

percent_encoding/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ impl<'a> Iterator for PercentEncode<'a> {
178178
}
179179
}
180180

181-
impl<'a> fmt::Display for PercentEncode<'a> {
181+
impl fmt::Display for PercentEncode<'_> {
182182
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
183183
for c in (*self).clone() {
184184
formatter.write_str(c)?
@@ -254,7 +254,7 @@ fn after_percent_sign(iter: &mut slice::Iter<'_, u8>) -> Option<u8> {
254254
Some(h as u8 * 0x10 + l as u8)
255255
}
256256

257-
impl<'a> Iterator for PercentDecode<'a> {
257+
impl Iterator for PercentDecode<'_> {
258258
type Item = u8;
259259

260260
fn next(&mut self) -> Option<u8> {

url/src/host.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pub enum Host<S = String> {
6464
Ipv6(Ipv6Addr),
6565
}
6666

67-
impl<'a> Host<&'a str> {
67+
impl Host<&str> {
6868
/// Return a copy of `self` that owns an allocated `String` but does not borrow an `&Url`.
6969
pub fn to_owned(&self) -> Host<String> {
7070
match *self {

url/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ impl Url {
448448
/// let base = Url::parse("https://alice.com/a")?;
449449
/// let url = base.join("http://eve.com/b")?;
450450
/// assert_eq!(url.as_str(), "http://eve.com/b"); // http instead of https
451-
451+
///
452452
/// # Ok(())
453453
/// # }
454454
/// # run().unwrap();
@@ -1492,7 +1492,7 @@ impl Url {
14921492
/// # }
14931493
/// # run().unwrap();
14941494
/// ```
1495-
1495+
///
14961496
#[inline]
14971497
pub fn query_pairs(&self) -> form_urlencoded::Parse<'_> {
14981498
form_urlencoded::parse(self.query().unwrap_or("").as_bytes())
@@ -1555,7 +1555,7 @@ impl Url {
15551555
/// # fn run() -> Result<(), ParseError> {
15561556
/// let mut url = Url::parse("https://example.com/data.csv")?;
15571557
/// assert_eq!(url.as_str(), "https://example.com/data.csv");
1558-
1558+
///
15591559
/// url.set_fragment(Some("cell=4,1-6,2"));
15601560
/// assert_eq!(url.as_str(), "https://example.com/data.csv#cell=4,1-6,2");
15611561
/// assert_eq!(url.fragment(), Some("cell=4,1-6,2"));
@@ -3177,7 +3177,7 @@ impl<'a> form_urlencoded::Target for UrlQuery<'a> {
31773177
type Finished = &'a mut Url;
31783178
}
31793179

3180-
impl<'a> Drop for UrlQuery<'a> {
3180+
impl Drop for UrlQuery<'_> {
31813181
fn drop(&mut self) {
31823182
if let Some(url) = self.url.take() {
31833183
url.restore_already_parsed_fragment(self.fragment.take())

url/src/parser.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ impl Pattern for char {
301301
}
302302
}
303303

304-
impl<'a> Pattern for &'a str {
304+
impl Pattern for &str {
305305
fn split_prefix(self, input: &mut Input) -> bool {
306306
for c in self.chars() {
307307
if input.next() != Some(c) {
@@ -318,7 +318,7 @@ impl<F: FnMut(char) -> bool> Pattern for F {
318318
}
319319
}
320320

321-
impl<'i> Iterator for Input<'i> {
321+
impl Iterator for Input<'_> {
322322
type Item = char;
323323
fn next(&mut self) -> Option<char> {
324324
self.chars

url/src/path_segments.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ pub fn new(url: &mut Url) -> PathSegmentsMut<'_> {
6767
}
6868
}
6969

70-
impl<'a> Drop for PathSegmentsMut<'a> {
70+
impl Drop for PathSegmentsMut<'_> {
7171
fn drop(&mut self) {
7272
self.url
7373
.restore_after_path(self.old_after_path_position, &self.after_path)
7474
}
7575
}
7676

77-
impl<'a> PathSegmentsMut<'a> {
77+
impl PathSegmentsMut<'_> {
7878
/// Remove all segments in the path, leaving the minimal `url.path() == "/"`.
7979
///
8080
/// Returns `&mut Self` so that method calls can be chained.

0 commit comments

Comments
 (0)