From a0593e3aa9b19b9ca3c3881cbe0d9d207fe46d2c Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Tue, 26 Nov 2024 07:48:30 +0000 Subject: refactor: err msgs 'cannot' > 'failed to' in nearly all cases 'cannot' was used when an action was tried and failed. 'failed to' is strictly better because: * just because the action didn't work that time doesnt mean it cannot work * it is better at drawing the users attention to a problem --- src/lib/git/identify_ahead_behind.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/lib/git/identify_ahead_behind.rs') diff --git a/src/lib/git/identify_ahead_behind.rs b/src/lib/git/identify_ahead_behind.rs index c98c994..d736522 100644 --- a/src/lib/git/identify_ahead_behind.rs +++ b/src/lib/git/identify_ahead_behind.rs @@ -16,7 +16,7 @@ pub fn identify_ahead_behind( name.to_string(), git_repo .get_tip_of_branch(name) - .context(format!("cannot find from_branch '{name}'"))?, + .context(format!("failed to find from_branch '{name}'"))?, ), None => ( if let Ok(name) = git_repo.get_checked_out_branch_name() { @@ -38,7 +38,7 @@ pub fn identify_ahead_behind( name.to_string(), git_repo .get_tip_of_branch(name) - .context(format!("cannot find to_branch '{name}'"))?, + .context(format!("failed to find to_branch '{name}'"))?, ), None => { let (name, commit) = git_repo @@ -82,7 +82,7 @@ mod tests { identify_ahead_behind(&git_repo, &Some(branch_name.to_string()), &None) .unwrap_err() .to_string(), - format!("cannot find from_branch '{}'", &branch_name), + format!("failed to find from_branch '{}'", &branch_name), ); Ok(()) } @@ -98,7 +98,7 @@ mod tests { identify_ahead_behind(&git_repo, &None, &Some(branch_name.to_string())) .unwrap_err() .to_string(), - format!("cannot find to_branch '{}'", &branch_name), + format!("failed to find to_branch '{}'", &branch_name), ); Ok(()) } -- cgit v1.2.3