Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
Code review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser committed Aug 16, 2022
1 parent 8c57ad3 commit 9461237
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,18 +210,18 @@ where
return write!(f, [content]);
}

// Adds as many nested `indent` elements until it reaches the desired indent level.
// Adds as many nested `indent` elements until it reaches the desired indention level.
let format_indented = format_with(|f| {
if level == 0 {
write!(f, [content])
} else {
let mut buffer = VecBuffer::new(f.state_mut());

write!(buffer, [indent(content)])?;
write!(buffer, [content])?;

let mut indented = buffer.into_element();

for _ in 1..level {
for _ in 0..level {
indented = FormatElement::Indent(vec![indented].into_boxed_slice());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ output
output
`;

// don't break
// Single Line
const bar =`but where will ${this.fanta} wrap ${baz} ${"hello"} template literal? ${bar.ff.sss} long long long long ${foo[3]} long long long long long long`;


// Fit
const foo = `but where will ${a && b && bar || c && d && g} wrap long long long long long long`;

const foo = `but where will ${lorem && loremlorem && loremlorem || loremc && lorem && loremlorem} wrap long long long long long long`;
Expand Down

0 comments on commit 9461237

Please sign in to comment.