提交 27b58edc 编写于 作者: G Guillaume Gomez

Update rustc --explain to the new error codes format

上级 411f94c3
...@@ -524,13 +524,13 @@ fn handle_explain(code: &str, ...@@ -524,13 +524,13 @@ fn handle_explain(code: &str,
let mut text = String::new(); let mut text = String::new();
// Slice off the leading newline and print. // Slice off the leading newline and print.
for line in description[1..].lines() { for line in description.lines() {
let indent_level = line.find(|c: char| !c.is_whitespace()) let indent_level = line.find(|c: char| !c.is_whitespace())
.unwrap_or_else(|| line.len()); .unwrap_or_else(|| line.len());
let dedented_line = &line[indent_level..]; let dedented_line = &line[indent_level..];
if dedented_line.starts_with("```") { if dedented_line.starts_with("```") {
is_in_code_block = !is_in_code_block; is_in_code_block = !is_in_code_block;
text.push_str(&line[..(indent_level+3)]); text.push_str(&line[..(indent_level + 3)]);
} else if is_in_code_block && dedented_line.starts_with("# ") { } else if is_in_code_block && dedented_line.starts_with("# ") {
continue; continue;
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册