From 6bb216c0d4ef6b4172ab8c82d6beacffef0c342d Mon Sep 17 00:00:00 2001 From: extrawurst <776816+extrawurst@users.noreply.github.com> Date: Tue, 28 Oct 2025 18:03:19 +0100 Subject: [PATCH] fix warnings and deny deprecated (#2753) * fix gitoxide warning * do not allow deprecated fn --- asyncgit/src/lib.rs | 3 +- asyncgit/src/sync/logwalker.rs | 2 +- asyncgit/src/sync/remotes/mod.rs | 48 ++++++++------------------------ asyncgit/src/sync/submodules.rs | 2 +- 4 files changed, 16 insertions(+), 39 deletions(-) diff --git a/asyncgit/src/lib.rs b/asyncgit/src/lib.rs index 8f2efa15..b9eccbe3 100644 --- a/asyncgit/src/lib.rs +++ b/asyncgit/src/lib.rs @@ -15,7 +15,8 @@ It wraps libraries like git2 and gix. unused_must_use, dead_code, unstable_name_collisions, - unused_assignments + unused_assignments, + deprecated )] #![deny(clippy::all, clippy::perf, clippy::nursery, clippy::pedantic)] #![deny( diff --git a/asyncgit/src/sync/logwalker.rs b/asyncgit/src/sync/logwalker.rs index cbadeb18..81a6fd32 100644 --- a/asyncgit/src/sync/logwalker.rs +++ b/asyncgit/src/sync/logwalker.rs @@ -133,7 +133,7 @@ impl<'a> LogWalkerWithoutFilter<'a> { // reason this is 2^14, so benchmarking might reveal that there’s better values. repo.object_cache_size_if_unset(2_usize.pow(14)); - let commit = repo.head()?.peel_to_commit_in_place()?; + let commit = repo.head()?.peel_to_commit()?; let tips = [commit.id]; diff --git a/asyncgit/src/sync/remotes/mod.rs b/asyncgit/src/sync/remotes/mod.rs index 6f1284f9..b32810dd 100644 --- a/asyncgit/src/sync/remotes/mod.rs +++ b/asyncgit/src/sync/remotes/mod.rs @@ -369,12 +369,8 @@ mod tests { let (remote_dir, _remote) = repo_init().unwrap(); let remote_path = remote_dir.path().to_str().unwrap(); let (repo_dir, _repo) = repo_clone(remote_path).unwrap(); - let repo_path: &RepoPath = &repo_dir - .into_path() - .as_os_str() - .to_str() - .unwrap() - .into(); + let repo_path: &RepoPath = + &repo_dir.keep().as_os_str().to_str().unwrap().into(); let remotes = get_remotes(repo_path).unwrap(); @@ -388,12 +384,8 @@ mod tests { let (remote_dir, _remote) = repo_init().unwrap(); let remote_path = remote_dir.path().to_str().unwrap(); let (repo_dir, _repo) = repo_clone(remote_path).unwrap(); - let repo_path: &RepoPath = &repo_dir - .into_path() - .as_os_str() - .to_str() - .unwrap() - .into(); + let repo_path: &RepoPath = + &repo_dir.keep().as_os_str().to_str().unwrap().into(); debug_cmd_print( repo_path, @@ -418,12 +410,8 @@ mod tests { let (remote_dir, _remote) = repo_init().unwrap(); let remote_path = remote_dir.path().to_str().unwrap(); let (repo_dir, _repo) = repo_clone(remote_path).unwrap(); - let repo_path: &RepoPath = &repo_dir - .into_path() - .as_os_str() - .to_str() - .unwrap() - .into(); + let repo_path: &RepoPath = + &repo_dir.keep().as_os_str().to_str().unwrap().into(); debug_cmd_print( repo_path, @@ -454,12 +442,8 @@ mod tests { let (remote_dir, _remote) = repo_init().unwrap(); let remote_path = remote_dir.path().to_str().unwrap(); let (repo_dir, _repo) = repo_clone(remote_path).unwrap(); - let repo_path: &RepoPath = &repo_dir - .into_path() - .as_os_str() - .to_str() - .unwrap() - .into(); + let repo_path: &RepoPath = + &repo_dir.keep().as_os_str().to_str().unwrap().into(); debug_cmd_print( repo_path, @@ -494,12 +478,8 @@ mod tests { let (remote_dir, _remote) = repo_init().unwrap(); let remote_path = remote_dir.path().to_str().unwrap(); let (repo_dir, repo) = repo_clone(remote_path).unwrap(); - let repo_path: &RepoPath = &repo_dir - .into_path() - .as_os_str() - .to_str() - .unwrap() - .into(); + let repo_path: &RepoPath = + &repo_dir.keep().as_os_str().to_str().unwrap().into(); debug_cmd_print( repo_path, @@ -530,12 +510,8 @@ mod tests { let (remote_dir, _remote) = repo_init().unwrap(); let remote_path = remote_dir.path().to_str().unwrap(); let (repo_dir, repo) = repo_clone(remote_path).unwrap(); - let repo_path: &RepoPath = &repo_dir - .into_path() - .as_os_str() - .to_str() - .unwrap() - .into(); + let repo_path: &RepoPath = + &repo_dir.keep().as_os_str().to_str().unwrap().into(); debug_cmd_print( repo_path, diff --git a/asyncgit/src/sync/submodules.rs b/asyncgit/src/sync/submodules.rs index f984ac0b..cdf69d51 100644 --- a/asyncgit/src/sync/submodules.rs +++ b/asyncgit/src/sync/submodules.rs @@ -182,7 +182,7 @@ mod tests { s.add_finalize().unwrap(); } - let repo_p = RepoPath::Path(dir.into_path()); + let repo_p = RepoPath::Path(dir.keep()); let subs = get_submodules(&repo_p).unwrap(); assert_eq!(subs.len(), 1);