From c4e033a1c1097f960c0884d46d5cc0910265e7b7 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Sun, 7 Jan 2024 11:29:36 -0500 Subject: [PATCH 1/2] Appease latest rustc nightly See https://github.com/rust-lang/rust/pull/118297. --- src/reference.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reference.rs b/src/reference.rs index 92eb18c635..70b22d9f2d 100644 --- a/src/reference.rs +++ b/src/reference.rs @@ -16,7 +16,7 @@ use crate::{ // internally const GIT_REFNAME_MAX: usize = 1024; -struct Refdb<'repo>(&'repo Repository); +struct Refdb<'repo>(#[allow(dead_code)] &'repo Repository); /// A structure to represent a git [reference][1]. /// From a316f79c5574e7dfb540234aa7224d438e78bc26 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Thu, 11 Jan 2024 07:57:43 -0800 Subject: [PATCH 2/2] Explain reason for `Refdb`. --- src/reference.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/reference.rs b/src/reference.rs index 70b22d9f2d..0af845d7c5 100644 --- a/src/reference.rs +++ b/src/reference.rs @@ -16,6 +16,12 @@ use crate::{ // internally const GIT_REFNAME_MAX: usize = 1024; +/// This is used to logically indicate that a [`raw::git_reference`] or +/// [`raw::git_reference_iterator`] holds a reference to [`raw::git_refdb`]. +/// It is not necessary to have a wrapper like this in the +/// [`marker::PhantomData`], since all that matters is that it is tied to the +/// lifetime of the [`Repository`], but this helps distinguish the actual +/// references involved. struct Refdb<'repo>(#[allow(dead_code)] &'repo Repository); /// A structure to represent a git [reference][1].