Skip to content

Commit ac36936

Browse files
committed
Code formatting
1 parent a063be0 commit ac36936

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

src/formatting/formatter.rs

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,12 @@ impl<'i> Formatter<'i> {
220220
}
221221

222222
fn switch_syntax(&mut self, new_syntax: Syntax) {
223-
if !self.buffer.is_empty() {
224-
self.fragments.push((
225-
self.current,
226-
Cow::Owned(std::mem::take(&mut self.buffer)),
227-
));
223+
if !self
224+
.buffer
225+
.is_empty()
226+
{
227+
self.fragments
228+
.push((self.current, Cow::Owned(std::mem::take(&mut self.buffer))));
228229
}
229230
self.current = new_syntax;
230231
}
@@ -234,11 +235,12 @@ impl<'i> Formatter<'i> {
234235
}
235236

236237
pub fn flush_current(&mut self) {
237-
if !self.buffer.is_empty() {
238-
self.fragments.push((
239-
self.current,
240-
Cow::Owned(std::mem::take(&mut self.buffer)),
241-
));
238+
if !self
239+
.buffer
240+
.is_empty()
241+
{
242+
self.fragments
243+
.push((self.current, Cow::Owned(std::mem::take(&mut self.buffer))));
242244
}
243245
}
244246

@@ -1247,7 +1249,10 @@ impl<'a, 'i> Line<'a, 'i> {
12471249

12481250
fn wrap_line(&mut self) {
12491251
// Emit all current fragments to the output
1250-
for (syntax, content) in self.current.drain(..) {
1252+
for (syntax, content) in self
1253+
.current
1254+
.drain(..)
1255+
{
12511256
self.output
12521257
.add_fragment(syntax, content);
12531258
}
@@ -1266,7 +1271,10 @@ impl<'a, 'i> Line<'a, 'i> {
12661271
.is_empty()
12671272
{
12681273
// Emit all current fragments to the output
1269-
for (syntax, content) in self.current.drain(..) {
1274+
for (syntax, content) in self
1275+
.current
1276+
.drain(..)
1277+
{
12701278
self.output
12711279
.add_fragment(syntax, content);
12721280
}

0 commit comments

Comments
 (0)