From 6488d227000c30e06b6ae50fa323d45d537698a7 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Fri, 2 Apr 2021 20:53:30 -0600 Subject: add helper function for empty tokenstring --- src/makefile/token.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/makefile/token.rs') diff --git a/src/makefile/token.rs b/src/makefile/token.rs index 3bb9f4e..5984901 100644 --- a/src/makefile/token.rs +++ b/src/makefile/token.rs @@ -23,6 +23,10 @@ impl<'a, T: 'a + ParseError<&'a str> + ContextError<&'a str>> Err<'a> for T {} pub struct TokenString(Vec); impl TokenString { + pub fn empty() -> Self { + Self(vec![]) + } + pub fn text(text: impl Into) -> Self { Self(vec![Token::Text(text.into())]) } -- cgit v1.2.3