Skip to content

Commit 6797bfd

Browse files
committed
rule over the code in libstd with an iron fist
1 parent 7064a0e commit 6797bfd

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/libstd/backtrace.rs

+4-9
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,7 @@ impl fmt::Debug for Backtrace {
168168
};
169169
capture.resolve();
170170

171-
let frames = if fmt.alternate() {
172-
&capture.frames[..]
173-
} else {
174-
&capture.frames[capture.actual_start..]
175-
};
171+
let frames = &capture.frames[capture.actual_start..];
176172

177173
write!(fmt, "Backtrace ")?;
178174

@@ -195,10 +191,9 @@ impl fmt::Debug for BacktraceSymbol {
195191
write!(fmt, "{{ ")?;
196192

197193
if let Some(fn_name) = self.name.as_ref().map(|b| backtrace::SymbolName::new(b)) {
198-
write!(fmt, "fn: ")?;
199-
fmt::Display::fmt(&fn_name, fmt)?;
194+
write!(fmt, "fn: \"{}\"", fn_name)?;
200195
} else {
201-
write!(fmt, "fn: <unknown>")?;
196+
write!(fmt, "fn: \"<unknown>\"")?;
202197
}
203198

204199
if let Some(fname) = self.filename.as_ref() {
@@ -221,7 +216,7 @@ impl fmt::Debug for BytesOrWide {
221216
BytesOrWide::Bytes(w) => BytesOrWideString::Bytes(w),
222217
BytesOrWide::Wide(w) => BytesOrWideString::Wide(w),
223218
},
224-
if fmt.alternate() { backtrace::PrintFmt::Full } else { backtrace::PrintFmt::Short },
219+
backtrace::PrintFmt::Short,
225220
crate::env::current_dir().as_ref().ok(),
226221
)
227222
}

0 commit comments

Comments
 (0)