From 39099037a5763cebbce47dbee963df6510200c51 Mon Sep 17 00:00:00 2001 From: Joscha Date: Tue, 22 Nov 2022 17:39:56 +0100 Subject: [PATCH] Remove unused functions --- src/ast/basic.rs | 11 ----------- src/ast/field.rs | 23 ----------------------- src/ast/lit.rs | 6 ------ src/ast/table_constr.rs | 12 ------------ 4 files changed, 52 deletions(-) diff --git a/src/ast/basic.rs b/src/ast/basic.rs index 867bcf1..8a722c3 100644 --- a/src/ast/basic.rs +++ b/src/ast/basic.rs @@ -39,17 +39,6 @@ impl Space { span, } } - - pub fn then(mut self, other: Self) -> Self { - self.lines.extend(other.lines); - self.span = self.span.join(other.span); - self - } - - pub fn then_line(mut self, line: Line) -> Self { - self.lines.push(line); - self - } } #[derive(Clone)] diff --git a/src/ast/field.rs b/src/ast/field.rs index 09beccd..5afd98f 100644 --- a/src/ast/field.rs +++ b/src/ast/field.rs @@ -94,29 +94,6 @@ impl Field { } } - pub fn access_ident(base: Box, ident: Ident, span: Span) -> Self { - Self::AccessIdent { - expr: base, - s0: Space::empty(span), - s1: Space::empty(span), - ident, - span, - } - } - - pub fn assign_ident(base: Box, ident: Ident, value: Box, span: Span) -> Self { - Self::AssignIdent { - expr: base, - s0: Space::empty(span), - s1: Space::empty(span), - ident, - s2: Space::empty(span), - s3: Space::empty(span), - value, - span, - } - } - pub fn expr(self) -> Expr { Expr::Field(self) } diff --git a/src/ast/lit.rs b/src/ast/lit.rs index 44df7ac..ecd166c 100644 --- a/src/ast/lit.rs +++ b/src/ast/lit.rs @@ -53,12 +53,6 @@ impl HasSpan for NumLit { } } -impl NumLit { - pub fn lit(self) -> Lit { - Lit::Num(self) - } -} - #[derive(Clone)] pub enum StringLitElem { /// Normal unescaped characters diff --git a/src/ast/table_constr.rs b/src/ast/table_constr.rs index 52696a4..38c409d 100644 --- a/src/ast/table_constr.rs +++ b/src/ast/table_constr.rs @@ -38,18 +38,6 @@ impl TableConstrElem { pub fn named(name: Ident, value: Box, span: Span) -> Self { Self::Lit(TableLitElem::named(name, value, span)) } - - pub fn indexed(index: Box, value: Box, span: Span) -> Self { - Self::Indexed { - s0: Space::empty(span), - index, - s1: Space::empty(span), - s2: Space::empty(span), - s3: Space::empty(span), - value, - span, - } - } } /// `{ a, b, foo: c, [d]: e }`