// FIXME: this is a terrible hack to indent the comments between the last
// item in the block and the closing brace to the block's level.
// The closing brace itself, however, should be indented at a shallower
// level.
this is a terrible hack to indent the comments between the last
item in the block and the closing brace to the block's level.
The closing brace itself, however, should be indented at a shallower
level.
this is a terrible hack to indent the comments between the last item in the block and the closing brace to the block ' s level . The closing brace itself however should be indented at a shallower level .
fn close_block(&mut self, unindent_comment: bool, span: Span) {
        let file_name: FileName = self.source_map.span_to_filename(span).into();
        let skip_this_line = !self
            .config
            .file_lines()
            .contains_line(&file_name, self.line_number);
        if !skip_this_line {
            let total_len = self.buffer.len();
            let chars_too_many = if unindent_comment {
                0
            } else if self.config.hard_tabs() {
                1
            } else {
                self.config.tab_spaces()
            };
            self.buffer.truncate(total_len - chars_too_many);
        }
        self.push_str("}");
        self.block_indent = self.block_indent.block_unindent(self.config);
    }
fn close_block ( & mut self , unindent_comment : bool , span : Span ) { let file_name : FileName = self . source_map . span_to_filename ( span ) . into ( ) ; let skip_this_line = ! self . config . file_lines ( ) . contains_line ( & file_name , self . line_number ) ; if ! skip_this_line { let total_len = self . buffer . len ( ) ; let chars_too_many = if unindent_comment { 0 } else if self . config . hard_tabs ( ) { 1 } else { self . config . tab_spaces ( ) } ; self . buffer . truncate ( total_len - chars_too_many ) ; } self . push_str ( " " ) ; self . block_indent = self . block_indent . block_unindent ( self . config ) ; }
FIXME: this is a terrible hack to indent the comments between the last
item in the block and the closing brace to the block's level.
FIXME : this is a terrible hack to indent the comments between the last item in the block and the closing brace to the block ' s level .
&mut self
unindent_comment
bool
span
Span