Skip to content

Commit

Permalink
build: fix lint warnings
Browse files Browse the repository at this point in the history
Fix warnings of the form

```
`to_string` applied to a type that implements `Display` in `format!` args
```
  • Loading branch information
arxanas committed Jan 18, 2022
1 parent 5a75052 commit f680141
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/commands/gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub fn mark_commit_reachable(repo: &Repo, commit_oid: NonZeroOid) -> eyre::Resul
return Ok(());
}

let ref_name = format!("refs/branchless/{}", commit_oid.to_string());
let ref_name = format!("refs/branchless/{}", commit_oid);
eyre::ensure!(
Reference::is_valid_name(&ref_name),
format!("Invalid ref name to mark commit as reachable: {}", ref_name)
Expand Down
2 changes: 1 addition & 1 deletion src/core/rewrite/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ mod in_memory {
// produce a spurious abandoned-branch warning.
let post_rewrite_stdin: String = rewritten_oids
.iter()
.map(|(old_oid, new_oid)| format!("{} {}\n", old_oid.to_string(), new_oid.to_string()))
.map(|(old_oid, new_oid)| format!("{} {}\n", old_oid, new_oid))
.collect();
let post_rewrite_stdin = OsString::from(post_rewrite_stdin);
git_run_info.run_hook(
Expand Down
4 changes: 2 additions & 2 deletions src/git/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ Either create it, or update the main branch setting by running:
None => {
let NonZeroOid { inner: oid } = oid;
Ok(StyledString::styled(
format!("<commit not available: {}>", oid.to_string()),
format!("<commit not available: {}>", oid),
BaseColor::Red.light(),
))
}
Expand Down Expand Up @@ -1455,7 +1455,7 @@ impl<'repo> Commit<'repo> {
let preview = StyledStringBuilder::from_lines(vec![
StyledStringBuilder::new()
.append_styled(
format!("Commit:\t{}", self.get_oid().to_string()),
format!("Commit:\t{}", self.get_oid()),
BaseColor::Yellow.light(),
)
.build(),
Expand Down

0 comments on commit f680141

Please sign in to comment.