Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
hateofhades committed Dec 26, 2024
1 parent fa10513 commit ac25be4
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src-tauri/src/git/git_commit.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
use super::{
git_commit_author::{GitCommitAuthor, GitCommitAuthorType},
git_files::GitFilesRequired,
git_folders::{GitFolders, GIT_FOLDER},
git_folders::GIT_FOLDER,
git_project::GitProject,
git_tree::GitTree,
object::{GitObject, Header},
};
use crate::errors::git_object_error::{CommitError, GitObjectError};
use core::fmt;
use serde::{Deserialize, Serialize};
use std::{
fs::{self, OpenOptions},
io::Write,
path::{Path, PathBuf},
};
use std::{fs::OpenOptions, io::Write, path::PathBuf};

pub enum CommitPrefix {
Tree,
Expand Down Expand Up @@ -163,11 +159,15 @@ impl GitCommit {
*/
pub fn checkout(&self, project: &GitProject) -> Result<(), GitObjectError> {
let files =
GitTree::from_hash(project, &self.get_tree_hash())?.get_object_blobs(project, None);
GitTree::from_hash(project, self.get_tree_hash())?.get_object_blobs(project, None);

let _ = files.iter().for_each(|file| {
files.iter().for_each(|file| {
let path = PathBuf::from(project.get_directory()).join(&file.0);
let file_in_fs = OpenOptions::new().write(true).create(true).open(path);
let file_in_fs = OpenOptions::new()
.write(true)
.truncate(true)
.create(true)
.open(path);

Check warning on line 170 in src-tauri/src/git/git_commit.rs

View check run for this annotation

Codecov / codecov/patch

src-tauri/src/git/git_commit.rs#L160-L170

Added lines #L160 - L170 were not covered by tests

if let Ok(mut file_in_fs) = file_in_fs {
let _ = file_in_fs.write_all(file.1.data());
Expand Down

0 comments on commit ac25be4

Please # to comment.