aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/makefile/mod.rs2
-rw-r--r--src/makefile/token.rs4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/makefile/mod.rs b/src/makefile/mod.rs
index 5f4ca15..d16ad65 100644
--- a/src/makefile/mod.rs
+++ b/src/makefile/mod.rs
@@ -396,7 +396,7 @@ impl<'a> Makefile<'a> {
line_tokens.strip_suffix("=");
line_tokens.trim_end();
}
- let mut value = TokenString::from(vec![]);
+ let mut value = TokenString::empty();
for (_, line) in lines_iter {
let line = line?;
if line == "endef" {
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<Token>);
impl TokenString {
+ pub fn empty() -> Self {
+ Self(vec![])
+ }
+
pub fn text(text: impl Into<String>) -> Self {
Self(vec![Token::Text(text.into())])
}