Skip to content

Commit 6bb216c

Browse files
authored
fix warnings and deny deprecated (#2753)
* fix gitoxide warning * do not allow deprecated fn
1 parent 88ace76 commit 6bb216c

File tree

4 files changed

+16
-39
lines changed

4 files changed

+16
-39
lines changed

asyncgit/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ It wraps libraries like git2 and gix.
1515
unused_must_use,
1616
dead_code,
1717
unstable_name_collisions,
18-
unused_assignments
18+
unused_assignments,
19+
deprecated
1920
)]
2021
#![deny(clippy::all, clippy::perf, clippy::nursery, clippy::pedantic)]
2122
#![deny(

asyncgit/src/sync/logwalker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ impl<'a> LogWalkerWithoutFilter<'a> {
133133
// reason this is 2^14, so benchmarking might reveal that there’s better values.
134134
repo.object_cache_size_if_unset(2_usize.pow(14));
135135

136-
let commit = repo.head()?.peel_to_commit_in_place()?;
136+
let commit = repo.head()?.peel_to_commit()?;
137137

138138
let tips = [commit.id];
139139

asyncgit/src/sync/remotes/mod.rs

Lines changed: 12 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -369,12 +369,8 @@ mod tests {
369369
let (remote_dir, _remote) = repo_init().unwrap();
370370
let remote_path = remote_dir.path().to_str().unwrap();
371371
let (repo_dir, _repo) = repo_clone(remote_path).unwrap();
372-
let repo_path: &RepoPath = &repo_dir
373-
.into_path()
374-
.as_os_str()
375-
.to_str()
376-
.unwrap()
377-
.into();
372+
let repo_path: &RepoPath =
373+
&repo_dir.keep().as_os_str().to_str().unwrap().into();
378374

379375
let remotes = get_remotes(repo_path).unwrap();
380376

@@ -388,12 +384,8 @@ mod tests {
388384
let (remote_dir, _remote) = repo_init().unwrap();
389385
let remote_path = remote_dir.path().to_str().unwrap();
390386
let (repo_dir, _repo) = repo_clone(remote_path).unwrap();
391-
let repo_path: &RepoPath = &repo_dir
392-
.into_path()
393-
.as_os_str()
394-
.to_str()
395-
.unwrap()
396-
.into();
387+
let repo_path: &RepoPath =
388+
&repo_dir.keep().as_os_str().to_str().unwrap().into();
397389

398390
debug_cmd_print(
399391
repo_path,
@@ -418,12 +410,8 @@ mod tests {
418410
let (remote_dir, _remote) = repo_init().unwrap();
419411
let remote_path = remote_dir.path().to_str().unwrap();
420412
let (repo_dir, _repo) = repo_clone(remote_path).unwrap();
421-
let repo_path: &RepoPath = &repo_dir
422-
.into_path()
423-
.as_os_str()
424-
.to_str()
425-
.unwrap()
426-
.into();
413+
let repo_path: &RepoPath =
414+
&repo_dir.keep().as_os_str().to_str().unwrap().into();
427415

428416
debug_cmd_print(
429417
repo_path,
@@ -454,12 +442,8 @@ mod tests {
454442
let (remote_dir, _remote) = repo_init().unwrap();
455443
let remote_path = remote_dir.path().to_str().unwrap();
456444
let (repo_dir, _repo) = repo_clone(remote_path).unwrap();
457-
let repo_path: &RepoPath = &repo_dir
458-
.into_path()
459-
.as_os_str()
460-
.to_str()
461-
.unwrap()
462-
.into();
445+
let repo_path: &RepoPath =
446+
&repo_dir.keep().as_os_str().to_str().unwrap().into();
463447

464448
debug_cmd_print(
465449
repo_path,
@@ -494,12 +478,8 @@ mod tests {
494478
let (remote_dir, _remote) = repo_init().unwrap();
495479
let remote_path = remote_dir.path().to_str().unwrap();
496480
let (repo_dir, repo) = repo_clone(remote_path).unwrap();
497-
let repo_path: &RepoPath = &repo_dir
498-
.into_path()
499-
.as_os_str()
500-
.to_str()
501-
.unwrap()
502-
.into();
481+
let repo_path: &RepoPath =
482+
&repo_dir.keep().as_os_str().to_str().unwrap().into();
503483

504484
debug_cmd_print(
505485
repo_path,
@@ -530,12 +510,8 @@ mod tests {
530510
let (remote_dir, _remote) = repo_init().unwrap();
531511
let remote_path = remote_dir.path().to_str().unwrap();
532512
let (repo_dir, repo) = repo_clone(remote_path).unwrap();
533-
let repo_path: &RepoPath = &repo_dir
534-
.into_path()
535-
.as_os_str()
536-
.to_str()
537-
.unwrap()
538-
.into();
513+
let repo_path: &RepoPath =
514+
&repo_dir.keep().as_os_str().to_str().unwrap().into();
539515

540516
debug_cmd_print(
541517
repo_path,

asyncgit/src/sync/submodules.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ mod tests {
182182
s.add_finalize().unwrap();
183183
}
184184

185-
let repo_p = RepoPath::Path(dir.into_path());
185+
let repo_p = RepoPath::Path(dir.keep());
186186
let subs = get_submodules(&repo_p).unwrap();
187187

188188
assert_eq!(subs.len(), 1);

0 commit comments

Comments
 (0)