From 4e9be8d2a4a81589269129c96485b53231aae07d Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Sat, 28 Aug 2021 21:46:45 -0700 Subject: [PATCH] rustfmt: format string literals --- rustfmt.toml | 1 + src/commands.rs | 22 ++++++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/rustfmt.toml b/rustfmt.toml index d0a79cefb..0e405e4c8 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,5 +1,6 @@ max_width = 100 wrap_comments = true +format_strings = true error_on_line_overflow = true group_imports = "StdExternalCrate" imports_granularity = "Module" diff --git a/src/commands.rs b/src/commands.rs index 57056ac14..907da8e5a 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -393,7 +393,12 @@ impl RepoCommandHelper { Some(RefTarget::Conflict { adds, .. }) => { for current_target in adds { if current_target == old_checkout { - writeln!(ui, "Branch {}'s target was rewritten, but not updating it since it's conflicted", branch_name)?; + writeln!( + ui, + "Branch {}'s target was rewritten, but not updating it \ + since it's conflicted", + branch_name + )?; } } } @@ -415,7 +420,8 @@ impl RepoCommandHelper { if evolve_result.num_failed > 0 { writeln!( ui, - "Failed to rebase {} descendant commits onto updated working copy (run `jj evolve`)", + "Failed to rebase {} descendant commits onto updated working copy (run \ + `jj evolve`)", evolve_result.num_failed )?; } @@ -730,7 +736,12 @@ fn update_branches_after_rewrite(ui: &mut Ui, mut_repo: &mut MutableRepo) -> io: if new_evolution.is_obsolete(current_target) && !old_evolution.is_obsolete(current_target) { - writeln!(ui, "Branch {}'s target was obsoleted, but not updating it since it's conflicted", branch_name )?; + writeln!( + ui, + "Branch {}'s target was obsoleted, but not updating it since it's \ + conflicted", + branch_name + )?; } } } @@ -985,7 +996,10 @@ fn get_app<'a, 'b>() -> App<'a, 'b> { ) .subcommand( SubCommand::with_name("walkrevs") - .about("Walk revisions that are ancestors of the second argument but not ancestors of the first") + .about( + "Walk revisions that are ancestors of the second argument but not ancestors \ + of the first", + ) .arg(Arg::with_name("unwanted").index(1).required(true)) .arg(Arg::with_name("wanted").index(2).required(true)), )