Skip to content

Commit

Permalink
Clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaslueg committed Jan 9, 2023
1 parent d620ec4 commit 92714b0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ mod tests {
let commit_oid_short = binding.as_str().unwrap();

let commit_hash = format!("{}", commit_oid);
let commit_hash_short = format!("{}", commit_oid_short);
let commit_hash_short = commit_oid_short.to_string();

assert!(commit_hash.starts_with(&commit_hash_short));

Expand Down Expand Up @@ -1156,7 +1156,7 @@ mod tests {
let commit_oid_short = binding.as_str().unwrap();

let commit_hash = format!("{}", commit_oid);
let commit_hash_short = format!("{}", commit_oid_short);
let commit_hash_short = commit_oid_short.to_string();

assert!(commit_hash.starts_with(&commit_hash_short));

Expand Down
2 changes: 1 addition & 1 deletion src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ pub fn get_repo_head(
Ok(Some((
branch.map(ToString::to_string),
format!("{}", commit),
format!("{}", commit_short.as_str().unwrap_or_default()),
commit_short.as_str().unwrap_or_default().to_string(),
)))
}
Err(ref e)
Expand Down
6 changes: 3 additions & 3 deletions tests/testbox_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ fn main() {
/// Hold on to the tempdir, it will be removed when dropped!
fn create(self) -> io::Result<tempfile::TempDir> {
fs::DirBuilder::new()
.create(&self.root.path().join("src"))
.create(self.root.path().join("src"))
.unwrap();
for (name, content) in self.files {
let fname = self.root.path().join(name);
let mut file = fs::File::create(&fname)?;
let mut file = fs::File::create(fname)?;
file.write_all(&content)?;
}
Ok(self.root)
Expand Down Expand Up @@ -274,7 +274,7 @@ fn main() {
let mut f = std::fs::OpenOptions::new()
.write(true)
.truncate(true)
.open(&root.path().join("src/main.rs"))
.open(root.path().join("src/main.rs"))
.unwrap();
f.write_all(
r#"
Expand Down

0 comments on commit 92714b0

Please sign in to comment.