Skip to content

Commit

Permalink
Revert "Adjust diagnostics reporter closure argument (#1175)"
Browse files Browse the repository at this point in the history
This reverts commit 886fc40.
  • Loading branch information
maciektr committed Mar 13, 2024
1 parent c7290d1 commit 327de5d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions scarb/src/compiler/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use anyhow::{Context, Result};
use cairo_lang_compiler::db::RootDatabase;
use cairo_lang_compiler::diagnostics::DiagnosticsReporter;
use cairo_lang_compiler::CompilerConfig;
use cairo_lang_diagnostics::{FormattedDiagnosticEntry, Severity};
use cairo_lang_diagnostics::Severity;
use cairo_lang_filesystem::db::FilesGroup;
use cairo_lang_filesystem::ids::{CrateId, CrateLongId};
use serde::Serialize;
Expand All @@ -21,12 +21,10 @@ pub fn build_compiler_config<'c>(
let diagnostics_reporter = DiagnosticsReporter::callback({
let config = ws.config();

|entry: FormattedDiagnosticEntry| {
let msg = entry
.message()
.strip_suffix('\n')
.unwrap_or(entry.message());
match entry.severity() {
|severity: Severity, diagnostic: String| {
let msg = diagnostic.clone();
let msg = msg.strip_suffix('\n').unwrap_or(diagnostic.as_str());
match severity {
Severity::Error => config.ui().error(msg),
Severity::Warning => config.ui().warn(msg),
};
Expand Down

0 comments on commit 327de5d

Please sign in to comment.