We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e0c4eaf commit 548b66cCopy full SHA for 548b66c
1 file changed
src/lib.rs
@@ -388,8 +388,11 @@ fn format_code_block(
388
.snippet
389
.rfind('}')
390
// trim whitespace when using `fn_single_line=true`
391
- //
392
- .map(|i| formatted.snippet[..i].strip_suffix(char::is_whitespace).map_or(i, str::len))
+ .map(|i| {
+ formatted.snippet[..i]
393
+ .strip_suffix(char::is_whitespace)
394
+ .map_or(i, str::len)
395
+ })
396
.unwrap_or_else(|| formatted.snippet.len());
397
398
// It's possible that `block_len < FN_MAIN_PREFIX.len()`. This can happen if the code block was
0 commit comments