Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 6 additions & 6 deletions core/datatests/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fn main() {
std::fs::create_dir(&test_root_dir).unwrap_or_else(|e| {
panic!(
"failed to create directory '{}', {e}",
&test_root_dir.display()
test_root_dir.display()
)
})
}
Expand All @@ -39,8 +39,8 @@ fn main() {
std::fs::rename(&staging_test_root_dir, &test_root_dir).unwrap_or_else(|e| {
panic!(
"unable to rename '{}' to '{}', {e}",
&staging_test_root_dir.display(),
&test_root_dir.display()
staging_test_root_dir.display(),
test_root_dir.display()
)
});
} else {
Expand All @@ -52,7 +52,7 @@ fn remove_dir_if_present(path: &PathBuf) {
match std::fs::remove_dir_all(path) {
Ok(()) => {}
Err(e) if matches!(e.kind(), ErrorKind::NotFound) => {}
Err(e) => panic!("unable to remove {}, {}", &path.display(), e),
Err(e) => panic!("unable to remove {}, {}", path.display(), e),
};
}

Expand All @@ -79,8 +79,8 @@ fn get_dir_entries(root: &PathBuf) -> Vec<DirEntry> {
fn read_file_bytes(file: &DirEntry) -> Vec<u8> {
let mut contents = vec![];
File::open(file.clone().into_path())
.unwrap_or_else(|e| panic!("failed to open '{}', {e}", &file.path().display()))
.unwrap_or_else(|e| panic!("failed to open '{}', {e}", file.path().display()))
.read_to_end(&mut contents)
.unwrap_or_else(|e| panic!("failed to read '{}', {e}", &file.path().display()));
.unwrap_or_else(|e| panic!("failed to read '{}', {e}", file.path().display()));
contents
}
2 changes: 1 addition & 1 deletion core/datatests/tests/suites/logical_line_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ fn assert_lines(
error_message.push_str(&format!(
"{} - line type: {:?}\n",
format_line(index, &line.line, tokens),
&line.line.get_line_type()
line.line.get_line_type()
))
});

Expand Down
3 changes: 1 addition & 2 deletions core/src/rules/optimising_line_formatter/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,7 @@ impl Debug for DebugFormattingSolution<'_, '_, '_> {
token_decision.requirement,
token_decision.decision,
token_decision.last_line_length,
&self
.line_contexts
self.line_contexts
.get_specific_context_stack(line_index as u32)
.with_data(&recon_node)
.parents_support_break()
Expand Down
2 changes: 1 addition & 1 deletion core/src/rules/optimising_line_formatter/requirements.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl InternalOptimisingLineFormatter<'_, '_> {
let parens_requirement = contexts_data
.get_last_context(context_matches!(CT::Brackets(_, _) | CT::SemicolonList))
.and_then(|(ctx, data)| {
Some(data.is_broken).filter(|_| ctx.context_type() != CT::SemicolonList)
(ctx.context_type() != CT::SemicolonList).then_some(data.is_broken)
})
.if_else_map(DR::MustBreak, DR::Indifferent);

Expand Down
Loading