chore: Fix clippy::needless_borrow up to an editor

This commit is contained in:
Piotr Osiewicz
2024-01-21 15:03:24 +01:00
parent c3102feeeb
commit 6c82380232
29 changed files with 86 additions and 88 deletions
+3 -3
View File
@@ -72,7 +72,7 @@ impl GitRepository for LibGitRepository {
// This check is required because index.get_path() unwraps internally :(
check_path_to_repo_path_errors(relative_file_path)?;
let oid = match index.get_path(&relative_file_path, STAGE_NORMAL) {
let oid = match index.get_path(relative_file_path, STAGE_NORMAL) {
Some(entry) => entry.id,
None => return Ok(None),
};
@@ -81,7 +81,7 @@ impl GitRepository for LibGitRepository {
Ok(Some(String::from_utf8(content)?))
}
match logic(&self, relative_file_path) {
match logic(self, relative_file_path) {
Ok(value) => return value,
Err(err) => log::error!("Error loading head text: {:?}", err),
}
@@ -199,7 +199,7 @@ impl GitRepository for LibGitRepository {
fn matches_index(repo: &LibGitRepository, path: &RepoPath, mtime: SystemTime) -> bool {
if let Some(index) = repo.index().log_err() {
if let Some(entry) = index.get_path(&path, 0) {
if let Some(entry) = index.get_path(path, 0) {
if let Some(mtime) = mtime.duration_since(SystemTime::UNIX_EPOCH).log_err() {
if entry.mtime.seconds() == mtime.as_secs() as i32
&& entry.mtime.nanoseconds() == mtime.subsec_nanos()