Skip to content

Commit 790c752

Browse files
committed
style: Remove needless lifetimes
This solves clippy warnings like this: ``` error: the following explicit lifetimes could be elided: 'a --> src/common.rs:30:6 | 30 | impl<'a> Text<'a> for String { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes = note: `-D clippy::needless-lifetimes` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::needless_lifetimes)]` help: elide the lifetimes | 30 - impl<'a> Text<'a> for String { 30 + impl Text<'_> for String { ```
1 parent 1340772 commit 790c752

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

src/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl<'a> Text<'a> for &'a str {
2727
type Value = Self;
2828
}
2929

30-
impl<'a> Text<'a> for String {
30+
impl Text<'_> for String {
3131
type Value = String;
3232
}
3333

src/format.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub(crate) trait Displayable {
4747
fn display(&self, f: &mut Formatter);
4848
}
4949

50-
impl<'a> Formatter<'a> {
50+
impl Formatter<'_> {
5151
pub fn new(style: &Style) -> Formatter {
5252
Formatter {
5353
buf: String::with_capacity(1024),

src/query/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub struct Document<'a, T: Text<'a>> {
1414
pub definitions: Vec<Definition<'a, T>>,
1515
}
1616

17-
impl<'a> Document<'a, String> {
17+
impl Document<'_, String> {
1818
pub fn into_static(self) -> Document<'static, String> {
1919
// To support both reference and owned values in the AST,
2020
// all string data is represented with the ::common::Str<'a, T: Text<'a>>

src/schema/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub struct Document<'a, T: Text<'a>> {
1010
pub definitions: Vec<Definition<'a, T>>,
1111
}
1212

13-
impl<'a> Document<'a, String> {
13+
impl Document<'_, String> {
1414
pub fn into_static(self) -> Document<'static, String> {
1515
// To support both reference and owned values in the AST,
1616
// all string data is represented with the ::common::Str<'a, T: Text<'a>>

src/tokenizer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ impl<'a> StreamOnce for TokenStream<'a> {
6868
}
6969
}
7070

71-
impl<'a> Positioned for TokenStream<'a> {
71+
impl Positioned for TokenStream<'_> {
7272
fn position(&self) -> Self::Position {
7373
self.position
7474
}
7575
}
7676

77-
impl<'a> ResetStream for TokenStream<'a> {
77+
impl ResetStream for TokenStream<'_> {
7878
type Checkpoint = Checkpoint;
7979
fn checkpoint(&self) -> Self::Checkpoint {
8080
Checkpoint {
@@ -357,7 +357,7 @@ impl<'a> TokenStream<'a> {
357357
}
358358
}
359359

360-
impl<'a> fmt::Display for Token<'a> {
360+
impl fmt::Display for Token<'_> {
361361
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
362362
write!(f, "{}[{:?}]", self.value, self.kind)
363363
}

0 commit comments

Comments
 (0)