diff options
Diffstat (limited to 'compiler/rustc_errors/src/markdown')
-rw-r--r-- | compiler/rustc_errors/src/markdown/parse.rs | 2 | ||||
-rw-r--r-- | compiler/rustc_errors/src/markdown/term.rs | 2 | ||||
-rw-r--r-- | compiler/rustc_errors/src/markdown/tests/term.rs | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_errors/src/markdown/parse.rs b/compiler/rustc_errors/src/markdown/parse.rs index 362a451fd..d3a08da62 100644 --- a/compiler/rustc_errors/src/markdown/parse.rs +++ b/compiler/rustc_errors/src/markdown/parse.rs @@ -272,7 +272,7 @@ fn parse_ordered_li(buf: &[u8]) -> Parsed<'_> { fn get_indented_section(buf: &[u8]) -> (&[u8], &[u8]) { let mut end = buf.len(); for (idx, window) in buf.windows(2).enumerate() { - let &[ch, next_ch] = window else {unreachable!("always 2 elements")}; + let &[ch, next_ch] = window else { unreachable!("always 2 elements") }; if idx >= buf.len().saturating_sub(2) && next_ch == b'\n' { // End of stream end = buf.len().saturating_sub(1); diff --git a/compiler/rustc_errors/src/markdown/term.rs b/compiler/rustc_errors/src/markdown/term.rs index e45ba6d2c..88c3c8b9f 100644 --- a/compiler/rustc_errors/src/markdown/term.rs +++ b/compiler/rustc_errors/src/markdown/term.rs @@ -149,7 +149,7 @@ fn write_wrapping<B: io::Write>( let Some((end_idx, _ch)) = iter.nth(ch_count) else { // Write entire line buf.write_all(to_write.as_bytes())?; - cur.set(cur.get()+to_write.chars().count()); + cur.set(cur.get() + to_write.chars().count()); break; }; diff --git a/compiler/rustc_errors/src/markdown/tests/term.rs b/compiler/rustc_errors/src/markdown/tests/term.rs index 3b31c6d62..6f68fb25a 100644 --- a/compiler/rustc_errors/src/markdown/tests/term.rs +++ b/compiler/rustc_errors/src/markdown/tests/term.rs @@ -63,7 +63,7 @@ fn test_wrapping_write() { #[test] fn test_output() { // Capture `--bless` when run via ./x - let bless = std::env::var("RUSTC_BLESS").unwrap_or_default() == "1"; + let bless = std::env::var_os("RUSTC_BLESS").is_some_and(|v| v != "0"); let ast = MdStream::parse_str(INPUT); let bufwtr = BufferWriter::stderr(ColorChoice::Always); let mut buffer = bufwtr.buffer(); |