From e37f3a891c57046d3437379947d50f77e5488cb0 Mon Sep 17 00:00:00 2001 From: Myriad-Dreamin Date: Sun, 16 Nov 2025 07:40:31 +0800 Subject: [PATCH] fix: misleading vars --- crates/tinymist-project/src/compiler.rs | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/crates/tinymist-project/src/compiler.rs b/crates/tinymist-project/src/compiler.rs index e6da9524..d5a6a850 100644 --- a/crates/tinymist-project/src/compiler.rs +++ b/crates/tinymist-project/src/compiler.rs @@ -882,19 +882,16 @@ impl ProjectInsState { move || { let compiled = if syntax_only { let main = graph.snap.world.main(); - let syntax_error = graph - .world() - .source(main) - .at(Span::from_range(main, 0..0)) - .and_then(|source| { - let errors = source.root().errors(); - if errors.is_empty() { - Ok(()) - } else { - Err(errors.into_iter().map(|s| s.into()).collect()) - } - }); - let diag = Arc::new(DiagnosticsTask::from_errors(syntax_error.err())); + let source_res = graph.world().source(main).at(Span::from_range(main, 0..0)); + let syntax_res = source_res.and_then(|source| { + let errors = source.root().errors(); + if errors.is_empty() { + Ok(()) + } else { + Err(errors.into_iter().map(|s| s.into()).collect()) + } + }); + let diag = Arc::new(DiagnosticsTask::from_errors(syntax_res.err())); CompiledArtifact { diag,