just playing with tangled

style: add semicolon at the end of expressions used as statements

+1
Cargo.toml
··· 134 134 135 135 [workspace.lints.clippy] 136 136 explicit_iter_loop = "warn" 137 + semicolon_if_nothing_returned = "warn" 137 138 uninlined_format_args = "warn" 138 139 139 140 # Insta suggests compiling these packages in opt mode for faster testing.
+1 -1
cli/src/cli_util.rs
··· 254 254 .modify(|filter| { 255 255 *filter = tracing_subscriber::EnvFilter::builder() 256 256 .with_default_directive(tracing::metadata::LevelFilter::DEBUG.into()) 257 - .from_env_lossy() 257 + .from_env_lossy(); 258 258 }) 259 259 .map_err(|err| internal_error_with_message("failed to enable debug logging", err))?; 260 260 tracing::info!("debug logging enabled");
+1 -1
cli/src/commands/config/set.rs
··· 100 100 AuthorChange::Email => &author.email, 101 101 }; 102 102 if new_value.as_str() != Some(orig_value) { 103 - warn_wc_author(ui, &author.name, &author.email)? 103 + warn_wc_author(ui, &author.name, &author.email)?; 104 104 } 105 105 } 106 106 Ok(())
+1 -1
cli/src/commands/init.rs
··· 74 74 ui.warning_default(), 75 75 "`--git` and `--git-repo` are deprecated. 76 76 Use `jj git init` instead" 77 - )? 77 + )?; 78 78 } else { 79 79 if !command.settings().allow_native_backend() { 80 80 return Err(user_error_with_hint(
+1 -1
cli/src/commands/operation/abandon.rs
··· 134 134 let mut locked_ws = workspace.start_working_copy_mutation()?; 135 135 let old_op_id = locked_ws.locked_wc().old_operation_id(); 136 136 if let Some((_, new_id)) = reparented_head_ops().find(|(old, _)| old.id() == old_op_id) { 137 - locked_ws.finish(new_id.clone())? 137 + locked_ws.finish(new_id.clone())?; 138 138 } else { 139 139 writeln!( 140 140 ui.warning_default(),
+1 -1
cli/src/commands/status.rs
··· 93 93 formatter.labeled("conflict"), 94 94 "There are unresolved conflicts at these paths:" 95 95 )?; 96 - print_conflicted_paths(&conflicts, formatter, &workspace_command)? 96 + print_conflicted_paths(&conflicts, formatter, &workspace_command)?; 97 97 } 98 98 99 99 let template = workspace_command.commit_summary_template();
+2 -2
cli/src/config.rs
··· 499 499 .add_source(from_toml!("config/revsets.toml")) 500 500 .add_source(from_toml!("config/templates.toml")); 501 501 if cfg!(unix) { 502 - builder = builder.add_source(from_toml!("config/unix.toml")) 502 + builder = builder.add_source(from_toml!("config/unix.toml")); 503 503 } 504 504 if cfg!(windows) { 505 - builder = builder.add_source(from_toml!("config/windows.toml")) 505 + builder = builder.add_source(from_toml!("config/windows.toml")); 506 506 } 507 507 builder.build().unwrap() 508 508 }
+2 -2
cli/src/diff_util.rs
··· 1282 1282 match token_type { 1283 1283 DiffTokenType::Matching => formatter.write_all(content)?, 1284 1284 DiffTokenType::Different => { 1285 - formatter.with_label("token", |formatter| formatter.write_all(content))? 1285 + formatter.with_label("token", |formatter| formatter.write_all(content))?; 1286 1286 } 1287 1287 } 1288 1288 } ··· 1402 1402 CopyOperation::Rename => ("renamed", "R"), 1403 1403 }; 1404 1404 let path = path_converter.format_copied_path(before_path, after_path); 1405 - writeln!(formatter.labeled(label), "{sigil} {path}")? 1405 + writeln!(formatter.labeled(label), "{sigil} {path}")?; 1406 1406 } else { 1407 1407 let path = path_converter.format_file_path(after_path); 1408 1408 match (before.is_present(), after.is_present()) {
+1 -1
cli/src/formatter.rs
··· 553 553 fn pop_label(&mut self) -> io::Result<()> { 554 554 self.labels.pop(); 555 555 if self.labels.is_empty() { 556 - self.write_new_style()? 556 + self.write_new_style()?; 557 557 } 558 558 Ok(()) 559 559 }
+5 -5
cli/src/merge_tools/builtin.rs
··· 265 265 .split_inclusive('\n') 266 266 .map(|line| Cow::Owned(line.to_owned())) 267 267 .collect(), 268 - }) 268 + }); 269 269 } 270 270 DiffHunk::Different(sides) => { 271 271 assert_eq!(sides.len(), 2, "only two inputs were provided to the diff"); ··· 285 285 make_section_changed_lines(right_side, scm_record::ChangeType::Added), 286 286 ] 287 287 .concat(), 288 - }) 288 + }); 289 289 } 290 290 } 291 291 } ··· 361 361 is_checked: false, 362 362 old_description: None, 363 363 new_description: Some(Cow::Owned(describe_binary(hash.as_deref(), num_bytes))), 364 - }) 364 + }); 365 365 } 366 366 367 367 ( ··· 426 426 is_checked: false, 427 427 old_description: Some(Cow::Owned(describe_binary(hash.as_deref(), num_bytes))), 428 428 new_description: None, 429 - }) 429 + }); 430 430 } 431 431 } 432 432 ··· 507 507 executable: file.get_file_mode() 508 508 == Some(scm_record::FileMode(mode::EXECUTABLE)), 509 509 }), 510 - ) 510 + ); 511 511 } 512 512 } 513 513 }
+1 -1
cli/src/movement_util.rs
··· 109 109 write!(formatter, "Working copy parent: ")?; 110 110 } 111 111 template.format(commit, formatter) 112 - }) 112 + }); 113 113 }); 114 114 115 115 cmd_err
+1 -1
cli/src/templater.rs
··· 206 206 impl<T: Template> Template for ConcatTemplate<T> { 207 207 fn format(&self, formatter: &mut TemplateFormatter) -> io::Result<()> { 208 208 for template in &self.0 { 209 - template.format(formatter)? 209 + template.format(formatter)?; 210 210 } 211 211 Ok(()) 212 212 }
+1 -1
cli/tests/test_git_colocated.rs
··· 618 618 let git_check_out_ref = |name| { 619 619 git_repo 620 620 .set_head_detached(git_repo.find_reference(name).unwrap().target().unwrap()) 621 - .unwrap() 621 + .unwrap(); 622 622 }; 623 623 624 624 test_env.jj_cmd_ok(&repo_path, &["git", "init", "--git-repo=."]);
+1 -1
cli/tests/test_log_command.rs
··· 328 328 insta::assert_debug_snapshot!( 329 329 stdout, 330 330 @r###""commit 3 line 1\n\ncommit 3 line 2\n\0commit 2 line 1\n\ncommit 2 line 2\n\0commit 1 line 1\n\ncommit 1 line 2\n\0""### 331 - ) 331 + ); 332 332 } 333 333 334 334 #[test]
+1 -1
cli/tests/test_next_prev_commands.rs
··· 610 610 Hint: Working copy parent: mzvwutvl bc4f4fe3 (empty) third 611 611 Hint: Working copy parent: kkmpptxz b0d21db3 (empty) second 612 612 Hint: Working copy parent: qpvuntsm fa15625b (empty) first 613 - "###) 613 + "###); 614 614 } 615 615 616 616 #[test]
+1 -1
cli/tests/test_parallelize_command.rs
··· 628 628 │ ○ 14ca4df576b3 4 parents: 629 629 ├─╯ 630 630 ◆ 000000000000 parents: 631 - "###) 631 + "###); 632 632 } 633 633 634 634 fn get_log_output(test_env: &TestEnvironment, cwd: &Path) -> String {
+1 -1
cli/tests/test_util_command.rs
··· 34 34 [...] 35 35 } 36 36 } 37 - "###) 37 + "###); 38 38 }); 39 39 } 40 40
+1 -1
lib/benches/diff_bench.rs
··· 197 197 } 198 198 "##, 199 199 ]) 200 - }) 200 + }); 201 201 }); 202 202 } 203 203
+1 -1
lib/src/commit.rs
··· 72 72 73 73 impl Hash for Commit { 74 74 fn hash<H: Hasher>(&self, state: &mut H) { 75 - self.id.hash(state) 75 + self.id.hash(state); 76 76 } 77 77 } 78 78
+2 -2
lib/src/content_hash.rs
··· 81 81 82 82 impl<T: ContentHash> ContentHash for Vec<T> { 83 83 fn hash(&self, state: &mut impl DigestUpdate) { 84 - self.as_slice().hash(state) 84 + self.as_slice().hash(state); 85 85 } 86 86 } 87 87 ··· 97 97 None => state.update(&0u32.to_le_bytes()), 98 98 Some(x) => { 99 99 state.update(&1u32.to_le_bytes()); 100 - x.hash(state) 100 + x.hash(state); 101 101 } 102 102 } 103 103 }
+1 -1
lib/src/default_index/entry.rs
··· 73 73 74 74 impl Hash for IndexEntry<'_> { 75 75 fn hash<H: Hasher>(&self, state: &mut H) { 76 - self.pos.hash(state) 76 + self.pos.hash(state); 77 77 } 78 78 } 79 79
+1 -1
lib/src/default_index/revset_graph_iterator.rs
··· 183 183 parent_edges 184 184 .iter() 185 185 .filter(|edge| known_ancestors.insert(edge.target)), 186 - ) 186 + ); 187 187 } 188 188 } 189 189 }
+1 -1
lib/src/default_index/store.rs
··· 233 233 change_id_length, 234 234 )?; 235 235 maybe_parent_file = Some(parent_file.clone()); 236 - mutable_index = DefaultMutableIndex::incremental(parent_file) 236 + mutable_index = DefaultMutableIndex::incremental(parent_file); 237 237 } 238 238 } 239 239
+1 -1
lib/src/diff.rs
··· 745 745 746 746 #[test] 747 747 fn test_find_word_ranges_multibyte() { 748 - assert_eq!(find_word_ranges("⊢".as_bytes()), vec![0..3]) 748 + assert_eq!(find_word_ranges("⊢".as_bytes()), vec![0..3]); 749 749 } 750 750 751 751 #[test]
+1 -1
lib/src/fileset.rs
··· 328 328 FilePattern::FilePath(path) => file_paths.push(path), 329 329 FilePattern::PrefixPath(path) => prefix_paths.push(path), 330 330 FilePattern::FileGlob { dir, pattern } => { 331 - file_globs.push((dir, pattern.clone())) 331 + file_globs.push((dir, pattern.clone())); 332 332 } 333 333 } 334 334 continue;
+2 -2
lib/src/git.rs
··· 1782 1782 // TODO Git warns when a duplicate config entry is found, we should 1783 1783 // consider doing the same. 1784 1784 ("path", PartialSubmoduleConfig { path: None, .. }) => { 1785 - map_entry.path = Some(config_value.to_string()) 1785 + map_entry.path = Some(config_value.to_string()); 1786 1786 } 1787 1787 ("url", PartialSubmoduleConfig { url: None, .. }) => { 1788 - map_entry.url = Some(config_value.to_string()) 1788 + map_entry.url = Some(config_value.to_string()); 1789 1789 } 1790 1790 _ => (), 1791 1791 };
+1 -1
lib/src/graph.rs
··· 85 85 reverse_edges.entry(target).or_default().push(GraphEdge { 86 86 target: node.clone(), 87 87 edge_type, 88 - }) 88 + }); 89 89 } 90 90 entries.push(node); 91 91 }
+2 -2
lib/src/local_backend.rs
··· 513 513 fn conflict_from_proto(proto: crate::protos::local_store::Conflict) -> Conflict { 514 514 let mut conflict = Conflict::default(); 515 515 for term in proto.removes { 516 - conflict.removes.push(conflict_term_from_proto(term)) 516 + conflict.removes.push(conflict_term_from_proto(term)); 517 517 } 518 518 for term in proto.adds { 519 - conflict.adds.push(conflict_term_from_proto(term)) 519 + conflict.adds.push(conflict_term_from_proto(term)); 520 520 } 521 521 conflict 522 522 }
+2 -2
lib/src/merge.rs
··· 424 424 425 425 impl<T> Extend<T> for MergeBuilder<T> { 426 426 fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I) { 427 - self.values.extend(iter) 427 + self.values.extend(iter); 428 428 } 429 429 } 430 430 ··· 512 512 513 513 impl<T: ContentHash> ContentHash for Merge<T> { 514 514 fn hash(&self, state: &mut impl DigestUpdate) { 515 - self.values.hash(state) 515 + self.values.hash(state); 516 516 } 517 517 } 518 518
+1 -1
lib/src/operation.rs
··· 67 67 68 68 impl Hash for Operation { 69 69 fn hash<H: Hasher>(&self, state: &mut H) { 70 - self.id.hash(state) 70 + self.id.hash(state); 71 71 } 72 72 } 73 73
+1 -1
lib/src/simple_op_heads_store.rs
··· 87 87 assert!(!old_ids.contains(new_id)); 88 88 self.add_op_head(new_id); 89 89 for old_id in old_ids { 90 - self.remove_op_head(old_id) 90 + self.remove_op_head(old_id); 91 91 } 92 92 } 93 93
+1 -1
lib/tests/test_bad_locking.rs
··· 32 32 let base_name = child_src.file_name().unwrap(); 33 33 let child_dst = dst.join(base_name); 34 34 if child_src.is_dir() { 35 - copy_directory(&child_src, &child_dst) 35 + copy_directory(&child_src, &child_dst); 36 36 } else { 37 37 std::fs::copy(&child_src, &child_dst).unwrap(); 38 38 }
+6 -6
lib/tests/test_conflicts.rs
··· 535 535 2 536 536 ), 537 537 None 538 - ) 538 + ); 539 539 } 540 540 541 541 #[test] ··· 631 631 2 632 632 ), 633 633 @"None" 634 - ) 634 + ); 635 635 } 636 636 637 637 #[test] ··· 746 746 3 747 747 ), 748 748 None 749 - ) 749 + ); 750 750 } 751 751 752 752 #[test] ··· 767 767 2 768 768 ), 769 769 None 770 - ) 770 + ); 771 771 } 772 772 773 773 #[test] ··· 790 790 2 791 791 ), 792 792 None 793 - ) 793 + ); 794 794 } 795 795 796 796 #[test] ··· 814 814 2 815 815 ), 816 816 None 817 - ) 817 + ); 818 818 } 819 819 820 820 #[test]
+1 -1
lib/tests/test_index.rs
··· 650 650 // u32: number of local change ids 651 651 // u32: number of overflow parent entries 652 652 // u32: number of overflow change id positions 653 - fs::write(entry.path(), b"\0".repeat(24)).unwrap() 653 + fs::write(entry.path(), b"\0".repeat(24)).unwrap(); 654 654 } 655 655 656 656 let repo = load_repo_at_head(&settings, test_repo.repo_path());
+1 -1
lib/tests/test_merged_tree.rs
··· 541 541 vec![expected_base1], 542 542 vec![expected_side1, expected_side2] 543 543 )) 544 - ) 544 + ); 545 545 } 546 546 547 547 #[test]