From b7050ef47b4e1ca101d99be0d581119812de833e Mon Sep 17 00:00:00 2001 From: Sam Sartor Date: Thu, 13 Jun 2019 11:04:30 -0600 Subject: [PATCH] loosen group lifetimes --- src/group.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/group.rs b/src/group.rs index 272e435f..7546532d 100644 --- a/src/group.rs +++ b/src/group.rs @@ -1,7 +1,7 @@ use proc_macro2::{Delimiter, Span}; use error::Result; -use parse::{ParseBuffer, ParseStream}; +use parse::ParseBuffer; use private; use token; @@ -36,7 +36,7 @@ pub struct Group<'a> { // Not public API. #[doc(hidden)] -pub fn parse_parens(input: ParseStream) -> Result { +pub fn parse_parens<'a>(input: &ParseBuffer<'a>) -> Result> { parse_delimited(input, Delimiter::Parenthesis).map(|(span, content)| Parens { token: token::Paren(span), content: content, @@ -45,7 +45,7 @@ pub fn parse_parens(input: ParseStream) -> Result { // Not public API. #[doc(hidden)] -pub fn parse_braces(input: ParseStream) -> Result { +pub fn parse_braces<'a>(input: &ParseBuffer<'a>) -> Result> { parse_delimited(input, Delimiter::Brace).map(|(span, content)| Braces { token: token::Brace(span), content: content, @@ -54,7 +54,7 @@ pub fn parse_braces(input: ParseStream) -> Result { // Not public API. #[doc(hidden)] -pub fn parse_brackets(input: ParseStream) -> Result { +pub fn parse_brackets<'a>(input: &ParseBuffer<'a>) -> Result> { parse_delimited(input, Delimiter::Bracket).map(|(span, content)| Brackets { token: token::Bracket(span), content: content, @@ -63,7 +63,7 @@ pub fn parse_brackets(input: ParseStream) -> Result { #[cfg(any(feature = "full", feature = "derive"))] impl private { - pub fn parse_group(input: ParseStream) -> Result { + pub fn parse_group<'a>(input: &ParseBuffer<'a>) -> Result> { parse_delimited(input, Delimiter::None).map(|(span, content)| Group { token: token::Group(span), content: content, @@ -71,7 +71,7 @@ impl private { } } -fn parse_delimited(input: ParseStream, delimiter: Delimiter) -> Result<(Span, ParseBuffer)> { +fn parse_delimited<'a>(input: &ParseBuffer<'a>, delimiter: Delimiter) -> Result<(Span, ParseBuffer<'a>)> { input.step(|cursor| { if let Some((content, span, rest)) = cursor.group(delimiter) { #[cfg(procmacro2_semver_exempt)]