diff options
| author | Laurențiu Nicola <lnicola@users.noreply.github.com> | 2025-07-28 17:42:46 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-28 17:42:46 +0000 |
| commit | 36df2c98c115567548b5255591230d8cb945f6b9 (patch) | |
| tree | cffe57c07ed1aacf9f12d0a1a3ad98454244235d /compiler/rustc_errors/src | |
| parent | 2e3688e5b2f0c8c2831bf807f3f2a83b3e8f2654 (diff) | |
| parent | cde861ef363b9121335fba830e2151557dcab985 (diff) | |
| download | rust-36df2c98c115567548b5255591230d8cb945f6b9.tar.gz rust-36df2c98c115567548b5255591230d8cb945f6b9.zip | |
Merge pull request #20321 from rust-lang/rustc-pull
Rustc pull update
Diffstat (limited to 'compiler/rustc_errors/src')
| -rw-r--r-- | compiler/rustc_errors/src/markdown/term.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_errors/src/markdown/term.rs b/compiler/rustc_errors/src/markdown/term.rs index 579e00b8b85..fe1d80bdbe8 100644 --- a/compiler/rustc_errors/src/markdown/term.rs +++ b/compiler/rustc_errors/src/markdown/term.rs @@ -18,7 +18,7 @@ thread_local! { pub(crate) fn entrypoint(stream: &MdStream<'_>, buf: &mut Buffer) -> io::Result<()> { #[cfg(not(test))] if let Some((w, _)) = termize::dimensions() { - WIDTH.with(|c| c.set(std::cmp::min(w, DEFAULT_COLUMN_WIDTH))); + WIDTH.set(std::cmp::min(w, DEFAULT_COLUMN_WIDTH)); } write_stream(stream, buf, None, 0)?; buf.write_all(b"\n") @@ -84,7 +84,7 @@ fn write_tt(tt: &MdTree<'_>, buf: &mut Buffer, indent: usize) -> io::Result<()> reset_cursor(); } MdTree::HorizontalRule => { - (0..WIDTH.with(Cell::get)).for_each(|_| buf.write_all(b"-").unwrap()); + (0..WIDTH.get()).for_each(|_| buf.write_all(b"-").unwrap()); reset_cursor(); } MdTree::Heading(n, stream) => { @@ -121,7 +121,7 @@ fn write_tt(tt: &MdTree<'_>, buf: &mut Buffer, indent: usize) -> io::Result<()> /// End of that block, just wrap the line fn reset_cursor() { - CURSOR.with(|cur| cur.set(0)); + CURSOR.set(0); } /// Change to be generic on Write for testing. If we have a link URL, we don't @@ -144,7 +144,7 @@ fn write_wrapping<B: io::Write>( buf.write_all(ind_ws)?; cur.set(indent); } - let ch_count = WIDTH.with(Cell::get) - cur.get(); + let ch_count = WIDTH.get() - cur.get(); let mut iter = to_write.char_indices(); let Some((end_idx, _ch)) = iter.nth(ch_count) else { // Write entire line |
