Skip to content

Commit 761e429

Browse files
committed
refactor: finish renaming hi-doc format
1 parent 5349cbf commit 761e429

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

crates/jrsonnet-cli/src/trace.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use clap::{Parser, ValueEnum};
22
use jrsonnet_evaluator::trace::{
3-
AssStrokeFormat, CompactFormat, ExplainingFormat, PathResolver, TraceFormat,
3+
CompactFormat, ExplainingFormat, HiDocFormat, PathResolver, TraceFormat,
44
};
55

66
#[derive(PartialEq, Eq, ValueEnum, Clone)]
@@ -42,7 +42,7 @@ impl TraceOpts {
4242
resolver,
4343
max_trace,
4444
}),
45-
TraceFormatName::HiDoc => Box::new(AssStrokeFormat {
45+
TraceFormatName::HiDoc => Box::new(HiDocFormat {
4646
resolver,
4747
max_trace,
4848
}),

crates/jrsonnet-evaluator/src/trace/mod.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -368,12 +368,12 @@ impl ExplainingFormat {
368368

369369
#[cfg(feature = "explaining-traces")]
370370
#[derive(Trace)]
371-
pub struct AssStrokeFormat {
371+
pub struct HiDocFormat {
372372
pub resolver: PathResolver,
373373
pub max_trace: usize,
374374
}
375375
#[cfg(feature = "explaining-traces")]
376-
impl TraceFormat for AssStrokeFormat {
376+
impl TraceFormat for HiDocFormat {
377377
fn write_trace(
378378
&self,
379379
out: &mut dyn std::fmt::Write,
@@ -420,7 +420,7 @@ impl TraceFormat for AssStrokeFormat {
420420
let rendered = builder.build();
421421
let ansi = source_to_ansi(&rendered);
422422
if let Some(loc) = &last_location {
423-
let _ = writeln!(out, "...because of {}", loc.0.source_path());
423+
let _ = writeln!(out, "...at {}", loc.0.source_path());
424424
}
425425
let _ = write!(out, "{}", ansi.trim_end());
426426
}
@@ -456,7 +456,8 @@ impl TraceFormat for AssStrokeFormat {
456456
writeln!(out)?;
457457
write!(out, "{flushed}")?;
458458
}
459-
write!(out, "{desc}")?;
459+
writeln!(out)?;
460+
write!(out, " {desc}")?;
460461
}
461462
}
462463

0 commit comments

Comments
 (0)