Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
strip left whitespace from doc
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
  • Loading branch information
arihant2math committed Feb 3, 2025
commit 0fc9606f5e858bf717fb794e3b3592a64b83d7ed
2 changes: 1 addition & 1 deletion compiler/codegen/src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3356,7 +3356,7 @@ fn split_doc<'a>(
if let Some((located_ast::Stmt::Expr(expr), body_rest)) = body.split_first() {
if let Some(doc) = try_get_constant_string(std::slice::from_ref(&expr.value)) {
if opts.optimize < 2 {
return (Some(doc), body_rest);
return (Some(doc.split("\n").map(|x| x.trim_start()).join("\n")), body_rest);
} else {
return (None, body_rest);
}
Expand Down