forked from mirrors/jj
cleanup: automated fixes by new Clippy version
This commit is contained in:
parent
043d118f1f
commit
af4d183c7e
5 changed files with 7 additions and 7 deletions
|
@ -553,7 +553,7 @@ impl MutableIndex {
|
|||
let buf = self.maybe_squash_with_ancestors().serialize();
|
||||
let mut hasher = Blake2b512::new();
|
||||
hasher.update(&buf);
|
||||
let index_file_id_hex = hex::encode(&hasher.finalize());
|
||||
let index_file_id_hex = hex::encode(hasher.finalize());
|
||||
let index_file_path = dir.join(&index_file_id_hex);
|
||||
|
||||
let mut temp_file = NamedTempFile::new_in(&dir)?;
|
||||
|
@ -744,7 +744,7 @@ impl<'a> CompositeIndex<'a> {
|
|||
|
||||
pub fn entry_by_id(&self, commit_id: &CommitId) -> Option<IndexEntry<'a>> {
|
||||
self.commit_id_to_pos(commit_id)
|
||||
.map(&|pos| self.entry_by_pos(pos))
|
||||
.map(|pos| self.entry_by_pos(pos))
|
||||
}
|
||||
|
||||
pub fn has_id(&self, commit_id: &CommitId) -> bool {
|
||||
|
@ -1085,7 +1085,7 @@ impl IndexSegment for ReadonlyIndex {
|
|||
None => PrefixResolution::NoMatch,
|
||||
Some(lookup_pos) => {
|
||||
let mut first_match = None;
|
||||
for i in lookup_pos.0..self.num_local_commits as u32 {
|
||||
for i in lookup_pos.0..self.num_local_commits {
|
||||
let entry = self.lookup_entry(i);
|
||||
let id = entry.commit_id();
|
||||
if !id.as_bytes().starts_with(bytes_prefix.as_bytes()) {
|
||||
|
|
|
@ -165,7 +165,7 @@ impl Backend for LocalBackend {
|
|||
let mut temp_file = NamedTempFile::new_in(&self.path)?;
|
||||
temp_file.write_all(target.as_bytes())?;
|
||||
let mut hasher = Blake2b512::new();
|
||||
hasher.update(&target.as_bytes());
|
||||
hasher.update(target.as_bytes());
|
||||
let id = SymlinkId::new(hasher.finalize().to_vec());
|
||||
|
||||
persist_content_addressed_temp_file(temp_file, self.symlink_path(&id))?;
|
||||
|
|
|
@ -329,7 +329,7 @@ impl MutableTable {
|
|||
let buf = self.maybe_squash_with_ancestors().serialize();
|
||||
let mut hasher = Blake2b512::new();
|
||||
hasher.update(&buf);
|
||||
let file_id_hex = hex::encode(&hasher.finalize());
|
||||
let file_id_hex = hex::encode(hasher.finalize());
|
||||
let file_path = store.dir.join(&file_id_hex);
|
||||
|
||||
let mut temp_file = NamedTempFile::new_in(&store.dir)?;
|
||||
|
|
|
@ -841,7 +841,7 @@ impl TreeState {
|
|||
fs::remove_file(&disk_path).ok();
|
||||
let mut parent_dir = disk_path.parent().unwrap();
|
||||
loop {
|
||||
if fs::remove_dir(&parent_dir).is_err() {
|
||||
if fs::remove_dir(parent_dir).is_err() {
|
||||
break;
|
||||
}
|
||||
parent_dir = parent_dir.parent().unwrap();
|
||||
|
|
|
@ -19,7 +19,7 @@ use crate::common::TestEnvironment;
|
|||
pub mod common;
|
||||
|
||||
fn init_git_repo(git_repo_path: &PathBuf) {
|
||||
let git_repo = git2::Repository::init(&git_repo_path).unwrap();
|
||||
let git_repo = git2::Repository::init(git_repo_path).unwrap();
|
||||
let git_blob_oid = git_repo.blob(b"some content").unwrap();
|
||||
let mut git_tree_builder = git_repo.treebuilder(None).unwrap();
|
||||
git_tree_builder
|
||||
|
|
Loading…
Reference in a new issue