From 61a66b188c41353fefc4d8840c6113a89d0b8fe2 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Mon, 28 Apr 2025 09:33:36 +1000 Subject: Use `PrintState::head` in `PrintState::block_to_string`. --- compiler/rustc_ast_pretty/src/pprust/state.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'compiler/rustc_ast_pretty') diff --git a/compiler/rustc_ast_pretty/src/pprust/state.rs b/compiler/rustc_ast_pretty/src/pprust/state.rs index 070e23fddea..985359e1234 100644 --- a/compiler/rustc_ast_pretty/src/pprust/state.rs +++ b/compiler/rustc_ast_pretty/src/pprust/state.rs @@ -1013,10 +1013,7 @@ pub trait PrintState<'a>: std::ops::Deref + std::ops::Dere fn block_to_string(&self, blk: &ast::Block) -> String { Self::to_string(|s| { - // Containing cbox, will be closed by `print_block` at `}`. - let cb = s.cbox(INDENT_UNIT); - // Head-ibox, will be closed by `print_block` after `{`. - let ib = s.ibox(0); + let (cb, ib) = s.head(""); s.print_block(blk, cb, ib) }) } -- cgit 1.4.1-3-g733a5