Skip to content

Commit 982bc1a

Browse files
committed
fix: warnings and unused code
1 parent 8e273a2 commit 982bc1a

File tree

1 file changed

+0
-47
lines changed

1 file changed

+0
-47
lines changed

src/format.rs

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use nu_ansi_term::Color;
22
use std::{
3-
cmp::Ordering,
43
fmt::{self, Write as _},
54
io,
65
};
@@ -12,14 +11,9 @@ use tracing_core::{
1211
pub(crate) const LINE_VERT: &str = "│";
1312
const LINE_HORIZ: &str = "─";
1413
pub(crate) const LINE_BRANCH: &str = "├";
15-
pub(crate) const LINE_BRANCH_DOWN: &str = "┬";
1614
pub(crate) const LINE_CLOSE: &str = "┘";
17-
pub(crate) const LINE_OPEN_DOWN: &str = "┌";
18-
pub(crate) const LINE_OPEN_UP: &str = "└";
1915
pub(crate) const LINE_OPEN: &str = "┐";
2016

21-
const LINE_DASH_VERT: &str = "┆";
22-
2317
#[derive(Debug, Copy, Clone)]
2418
pub(crate) enum SpanMode {
2519
/// Executed on the parent before entering a child span
@@ -30,11 +24,6 @@ pub(crate) enum SpanMode {
3024
Close {
3125
verbose: bool,
3226
},
33-
/// Connects two disjoint levels of indentation together for the `pre_open` lines to connect
34-
RetraceBoundary {
35-
to: usize,
36-
from: usize,
37-
},
3827
/// A span has been entered but another *different* span has been entered in the meantime.
3928
Retrace {
4029
verbose: bool,
@@ -327,9 +316,6 @@ pub(crate) fn write_span_mode(buf: &mut String, style: SpanMode) {
327316
SpanMode::Close { verbose: true } => buf.push_str("close(v)"),
328317
SpanMode::Close { verbose: false } => buf.push_str("close"),
329318
SpanMode::PreOpen => buf.push_str("pre_open"),
330-
SpanMode::RetraceBoundary { to, from } => {
331-
write!(buf, "retrace_boundary({}:{})", from, to).unwrap()
332-
}
333319
SpanMode::PostClose => buf.push_str("post_close"),
334320
SpanMode::Event => buf.push_str("event"),
335321
}
@@ -359,7 +345,6 @@ fn indent_block_with_lines(
359345
SpanMode::Open { .. } => buf.push_str(LINE_OPEN),
360346
SpanMode::Retrace { .. } => buf.push_str(LINE_OPEN),
361347
SpanMode::Close { .. } => buf.push_str(LINE_CLOSE),
362-
SpanMode::RetraceBoundary { .. } => unreachable!(),
363348
SpanMode::PreOpen { .. } | SpanMode::PostClose => {}
364349
SpanMode::Event => {}
365350
}
@@ -394,37 +379,6 @@ fn indent_block_with_lines(
394379
}
395380
buf.push_str(LINE_OPEN);
396381
}
397-
// Print a divider connecting two diverged indents
398-
SpanMode::RetraceBoundary { to, from } => {
399-
let write_line = |s: &mut String, len| {
400-
for _ in 0..len {
401-
s.push_str(LINE_HORIZ);
402-
}
403-
};
404-
405-
match to.cmp(&from) {
406-
// |
407-
// *--------*
408-
// |
409-
Ordering::Less => {
410-
buf.push_str(LINE_OPEN_DOWN);
411-
write_line(buf, (from - to - 1) * indent_amount);
412-
buf.push_str(LINE_CLOSE);
413-
}
414-
// |
415-
// *
416-
// |
417-
Ordering::Equal => buf.push_str(LINE_DASH_VERT),
418-
// |
419-
// *--------*
420-
// |
421-
Ordering::Greater => {
422-
buf.push_str(LINE_OPEN_UP);
423-
write_line(buf, to - from);
424-
buf.push_str(LINE_OPEN);
425-
}
426-
}
427-
}
428382
SpanMode::Open { verbose: false } | SpanMode::Retrace { verbose: false } => {
429383
buf.push_str(LINE_BRANCH);
430384
for _ in 1..indent_amount {
@@ -533,7 +487,6 @@ fn indent_block(
533487
SpanMode::PreOpen | SpanMode::PostClose => {
534488
indent += 1;
535489
}
536-
SpanMode::RetraceBoundary { to, from } => indent = to.min(from),
537490
_ => (),
538491
}
539492

0 commit comments

Comments
 (0)