aboutsummaryrefslogtreecommitdiff
path: root/src/makefile/token.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/makefile/token.rs')
-rw-r--r--src/makefile/token.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/makefile/token.rs b/src/makefile/token.rs
index 4fde3e5..811f30f 100644
--- a/src/makefile/token.rs
+++ b/src/makefile/token.rs
@@ -27,7 +27,7 @@ impl TokenString {
&mut self.0[0]
}
- pub(crate) fn split_once(&self, delimiter: char) -> Option<(TokenString, TokenString)> {
+ pub(crate) fn split_once(&self, delimiter: char) -> Option<(Self, Self)> {
let mut result0 = vec![];
let mut iter = self.0.iter();
while let Some(t) = iter.next() {
@@ -39,7 +39,7 @@ impl TokenString {
result0.push(Token::Text(pieces[0].into()));
let mut result1 = vec![Token::Text(pieces[1].into())];
result1.extend(iter.cloned());
- return Some((TokenString(result0), TokenString(result1)));
+ return Some((Self(result0), Self(result1)));
}
_ => result0.push(t.clone()),
}
@@ -62,7 +62,7 @@ impl TokenString {
}
}
- pub(crate) fn extend(&mut self, other: TokenString) {
+ pub(crate) fn extend(&mut self, other: Self) {
self.0.extend(other.0);
}
@@ -94,12 +94,12 @@ pub(crate) enum Token {
impl fmt::Display for Token {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
- Token::Text(t) => write!(f, "{}", t),
- Token::MacroExpansion {
+ Self::Text(t) => write!(f, "{}", t),
+ Self::MacroExpansion {
name,
replacement: None,
} => write!(f, "$({})", name),
- Token::MacroExpansion {
+ Self::MacroExpansion {
name,
replacement: Some((r1, r2)),
} => write!(f, "$({}:{}={})", name, r1, r2),