Skip to content

style: Remove needless lifetimes #92

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl<'a> Text<'a> for &'a str {
type Value = Self;
}

impl<'a> Text<'a> for String {
impl Text<'_> for String {
type Value = String;
}

Expand Down
2 changes: 1 addition & 1 deletion src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub(crate) trait Displayable {
fn display(&self, f: &mut Formatter);
}

impl<'a> Formatter<'a> {
impl Formatter<'_> {
pub fn new(style: &Style) -> Formatter {
Formatter {
buf: String::with_capacity(1024),
Expand Down
2 changes: 1 addition & 1 deletion src/query/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub struct Document<'a, T: Text<'a>> {
pub definitions: Vec<Definition<'a, T>>,
}

impl<'a> Document<'a, String> {
impl Document<'_, String> {
pub fn into_static(self) -> Document<'static, String> {
// To support both reference and owned values in the AST,
// all string data is represented with the ::common::Str<'a, T: Text<'a>>
Expand Down
2 changes: 1 addition & 1 deletion src/schema/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub struct Document<'a, T: Text<'a>> {
pub definitions: Vec<Definition<'a, T>>,
}

impl<'a> Document<'a, String> {
impl Document<'_, String> {
pub fn into_static(self) -> Document<'static, String> {
// To support both reference and owned values in the AST,
// all string data is represented with the ::common::Str<'a, T: Text<'a>>
Expand Down
6 changes: 3 additions & 3 deletions src/tokenizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ impl<'a> StreamOnce for TokenStream<'a> {
}
}

impl<'a> Positioned for TokenStream<'a> {
impl Positioned for TokenStream<'_> {
fn position(&self) -> Self::Position {
self.position
}
}

impl<'a> ResetStream for TokenStream<'a> {
impl ResetStream for TokenStream<'_> {
type Checkpoint = Checkpoint;
fn checkpoint(&self) -> Self::Checkpoint {
Checkpoint {
Expand Down Expand Up @@ -357,7 +357,7 @@ impl<'a> TokenStream<'a> {
}
}

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