Skip to content

Commit 3605770

Browse files
committed
rename postprocess_tree field to output_tree
1 parent 8ac586a commit 3605770

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/formatter.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,12 @@ struct Formatter {
4141
config: FormatterConfig,
4242
parser: Parser,
4343
input_tree: Tree,
44-
postprocess_tree: Option<Tree>,
44+
output_tree: Option<Tree>,
4545
}
4646

4747
impl Formatter {
4848
#[inline(always)]
4949
fn new(content: String, config: FormatterConfig) -> Self {
50-
// Save original syntax tree for verification
5150
let mut parser = tree_sitter::Parser::new();
5251
parser
5352
.set_language(&tree_sitter_gdscript::LANGUAGE.into())
@@ -59,7 +58,7 @@ impl Formatter {
5958
config,
6059
input_tree,
6160
parser,
62-
postprocess_tree: None,
61+
output_tree: None,
6362
}
6463
}
6564

@@ -142,9 +141,8 @@ impl Formatter {
142141
/// Finishes formatting and returns the resulting file content.
143142
#[inline(always)]
144143
fn finish(mut self) -> Result<String, Box<dyn std::error::Error>> {
145-
// This will be Some if config.safe is true
146144
if self.config.safe {
147-
let mut tree = self.postprocess_tree.unwrap();
145+
let mut tree = self.output_tree.unwrap();
148146
tree = self.parser.parse(&self.content, Some(&tree)).unwrap();
149147

150148
if !compare_trees(self.input_tree, tree) {
@@ -264,7 +262,7 @@ impl Formatter {
264262

265263
self.reorder(&mut tree);
266264

267-
self.postprocess_tree = Some(tree);
265+
self.output_tree = Some(tree);
268266

269267
self
270268
}

0 commit comments

Comments
 (0)