Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarah Irbis committed May 2, 2022
1 parent c3c6707 commit f6d6117
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/cm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,13 +549,13 @@ impl<'a, 'o> CommonMarkFormatter<'a, 'o> {
write!(self, "`").unwrap();
}

let all_space = literal.iter().all(|&c| c==b' ' || c==b'\r' || c==b'\n');
let all_space = literal
.iter()
.all(|&c| c == b' ' || c == b'\r' || c == b'\n');
let has_edge_space = literal[0] == b' ' || literal[literal.len() - 1] == b' ';
let has_edge_backtick = literal[0] == b'`' || literal[literal.len() - 1] == b'`';
let has_edge_backtick = literal[0] == b'`' || literal[literal.len() - 1] == b'`';

let pad = literal.is_empty()
|| has_edge_backtick
|| (!all_space && has_edge_space);
let pad = literal.is_empty() || has_edge_backtick || (!all_space && has_edge_space);
if pad {
write!(self, " ").unwrap();
}
Expand Down

0 comments on commit f6d6117

Please sign in to comment.