From cffe9f4085cf28e9a1e62346cfb31ed0470a49ff Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Tue, 6 Apr 2021 15:30:47 -0600 Subject: appease our wire lord and savior --- src/makefile/token.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/makefile/token.rs') diff --git a/src/makefile/token.rs b/src/makefile/token.rs index 31adcfc..63c48d9 100644 --- a/src/makefile/token.rs +++ b/src/makefile/token.rs @@ -192,21 +192,21 @@ enum Delimiter { } impl Delimiter { - fn start(&self) -> &'static str { + const fn start(&self) -> &'static str { match self { Self::Parens => "(", Self::Braces => "{", } } - fn start_char(&self) -> char { + const fn start_char(&self) -> char { match self { Self::Parens => '(', Self::Braces => '{', } } - fn end(&self) -> &'static str { + const fn end(&self) -> &'static str { match self { Self::Parens => ")", Self::Braces => "}", @@ -317,7 +317,7 @@ fn text_but_not<'a, E: Err<'a>>( ) -> impl FnMut(&'a str) -> IResult<&'a str, TokenString, E> { map( take_till1(move |c| c == '$' || ends.contains(&c)), - |x: &str| TokenString::text(x), // TODO don't allocate an entire Vec for that + TokenString::text, // TODO don't allocate an entire Vec for that ) } @@ -349,7 +349,7 @@ fn single_token_but_not<'a, E: Err<'a>>( alt(( text_but_not(tbn_ends), macro_expansion, - nested_delimiters(ends.clone(), context), + nested_delimiters(ends, context), )) } -- cgit v1.2.3