workspace/rust/clippy: Fix all warnings
Fix clippy warnings following the upgrade of the Rust toolchain to version 1.90. Almost all are "mismatched_lifetime_syntaxes".
This commit is contained in:
parent
e1b4065353
commit
b0beef4391
|
|
@ -455,7 +455,7 @@ impl FileReviewBuilder {
|
|||
}
|
||||
}
|
||||
|
||||
fn item_diff(&mut self, item: ReviewItem) -> Result<git::raw::Diff, Error> {
|
||||
fn item_diff(&mut self, item: ReviewItem) -> Result<git::raw::Diff<'_>, Error> {
|
||||
let mut buf = Vec::new();
|
||||
let mut writer = unified_diff::Writer::new(&mut buf);
|
||||
writer.encode(&self.header)?;
|
||||
|
|
|
|||
|
|
@ -251,7 +251,7 @@ pub fn is_signing_configured(repo: &Path) -> Result<bool, anyhow::Error> {
|
|||
}
|
||||
|
||||
/// Return the list of radicle remotes for the given repository.
|
||||
pub fn rad_remotes(repo: &Repository) -> anyhow::Result<Vec<Remote>> {
|
||||
pub fn rad_remotes(repo: &Repository) -> anyhow::Result<Vec<Remote<'_>>> {
|
||||
let remotes: Vec<_> = repo
|
||||
.remotes()?
|
||||
.iter()
|
||||
|
|
@ -273,7 +273,7 @@ pub fn is_remote(repo: &Repository, alias: &str) -> anyhow::Result<bool> {
|
|||
}
|
||||
|
||||
/// Get the repository's "rad" remote.
|
||||
pub fn rad_remote(repo: &Repository) -> anyhow::Result<(git::raw::Remote, RepoId)> {
|
||||
pub fn rad_remote(repo: &Repository) -> anyhow::Result<(git::raw::Remote<'_>, RepoId)> {
|
||||
match radicle::rad::remote(repo) {
|
||||
Ok((remote, id)) => Ok((remote, id)),
|
||||
Err(radicle::rad::RemoteError::NotFound(_)) => Err(anyhow!(
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ impl SetupRemote<'_> {
|
|||
&self,
|
||||
name: impl AsRef<RefStr>,
|
||||
node: NodeId,
|
||||
) -> anyhow::Result<(git::Remote, Option<BranchName>)> {
|
||||
) -> anyhow::Result<(git::Remote<'_>, Option<BranchName>)> {
|
||||
let remote_url = radicle::git::Url::from(self.rid).with_namespace(node);
|
||||
let remote_name = name.as_ref();
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ pub fn branches(target: &Oid, repo: &git::raw::Repository) -> anyhow::Result<Vec
|
|||
}
|
||||
|
||||
#[inline]
|
||||
pub fn try_branch(reference: git::raw::Reference<'_>) -> anyhow::Result<git::raw::Branch> {
|
||||
pub fn try_branch(reference: git::raw::Reference<'_>) -> anyhow::Result<git::raw::Branch<'_>> {
|
||||
let branch = if reference.is_branch() {
|
||||
git::raw::Branch::wrap(reference)
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -360,7 +360,7 @@ impl PublicKey {
|
|||
}
|
||||
|
||||
#[cfg(feature = "git-ref-format-core")]
|
||||
pub fn to_component(&self) -> git_ref_format_core::Component {
|
||||
pub fn to_component(&self) -> git_ref_format_core::Component<'_> {
|
||||
git_ref_format_core::Component::from(self)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,14 +42,6 @@ pub struct Resolve {
|
|||
pub err: git::raw::Error,
|
||||
}
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
#[error("failed to scan for refs matching {pattern}")]
|
||||
pub struct Scan {
|
||||
pub pattern: radicle::git::fmt::refspec::PatternString,
|
||||
#[source]
|
||||
pub err: git::raw::Error,
|
||||
}
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum Update {
|
||||
#[error(transparent)]
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ impl<Tree, Parent> CommitData<Tree, Parent> {
|
|||
|
||||
/// The [`Signature`]s found in this commit, i.e. the headers corresponding
|
||||
/// to `gpgsig`.
|
||||
pub fn signatures(&self) -> impl Iterator<Item = Signature> + '_ {
|
||||
pub fn signatures(&self) -> impl Iterator<Item = Signature<'_>> + '_ {
|
||||
self.headers.signatures()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ impl Headers {
|
|||
.filter_map(move |(k, v)| (k == name).then_some(v))
|
||||
}
|
||||
|
||||
pub fn signatures(&self) -> impl Iterator<Item = Signature> + '_ {
|
||||
pub fn signatures(&self) -> impl Iterator<Item = Signature<'_>> + '_ {
|
||||
self.0.iter().filter_map(|(k, v)| {
|
||||
if k == "gpgsig" {
|
||||
Signature::from_str(v).ok()
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ impl Peers {
|
|||
self.0.get_mut(token)
|
||||
}
|
||||
|
||||
fn entry(&mut self, token: Token) -> Entry<Token, Peer> {
|
||||
fn entry(&mut self, token: Token) -> Entry<'_, Token, Peer> {
|
||||
self.0.entry(token)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ impl<T, const N: usize> BoundedVec<T, N> {
|
|||
}
|
||||
|
||||
/// Calls [`std::vec::Drain`].
|
||||
pub fn drain<R: RangeBounds<usize>>(&mut self, range: R) -> std::vec::Drain<T> {
|
||||
pub fn drain<R: RangeBounds<usize>>(&mut self, range: R) -> std::vec::Drain<'_, T> {
|
||||
self.v.drain(range)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1086,7 +1086,7 @@ where
|
|||
from: &NodeId,
|
||||
refs_at: Vec<RefsAt>,
|
||||
timeout: time::Duration,
|
||||
) -> Result<&mut FetchState, TryFetchError> {
|
||||
) -> Result<&mut FetchState, TryFetchError<'_>> {
|
||||
let from = *from;
|
||||
let Some(session) = self.sessions.get_mut(&from) else {
|
||||
return Err(TryFetchError::SessionNotConnected);
|
||||
|
|
|
|||
|
|
@ -171,7 +171,10 @@ pub enum Branch {
|
|||
impl Branch {
|
||||
/// Return the branch name to be used for the local branch when creating a
|
||||
/// patch.
|
||||
pub fn to_branch_name(self, object: &radicle::patch::PatchId) -> Option<git::fmt::Qualified> {
|
||||
pub fn to_branch_name(
|
||||
self,
|
||||
object: &radicle::patch::PatchId,
|
||||
) -> Option<git::fmt::Qualified<'_>> {
|
||||
match self {
|
||||
Self::None => None,
|
||||
Self::MirrorUpstream => Some(git::refs::patch(object)),
|
||||
|
|
|
|||
|
|
@ -167,11 +167,11 @@ impl Encoding for Buffer {
|
|||
/// A cursor-like trait to read SSH-encoded things.
|
||||
pub trait Reader {
|
||||
/// Create an SSH reader for `self`.
|
||||
fn reader(&self, starting_at: usize) -> Cursor;
|
||||
fn reader(&self, starting_at: usize) -> Cursor<'_>;
|
||||
}
|
||||
|
||||
impl Reader for Buffer {
|
||||
fn reader(&self, starting_at: usize) -> Cursor {
|
||||
fn reader(&self, starting_at: usize) -> Cursor<'_> {
|
||||
Cursor {
|
||||
s: self,
|
||||
position: starting_at,
|
||||
|
|
@ -180,7 +180,7 @@ impl Reader for Buffer {
|
|||
}
|
||||
|
||||
impl Reader for [u8] {
|
||||
fn reader(&self, starting_at: usize) -> Cursor {
|
||||
fn reader(&self, starting_at: usize) -> Cursor<'_> {
|
||||
Cursor {
|
||||
s: self,
|
||||
position: starting_at,
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ impl Identity {
|
|||
|
||||
pub fn load_mut<R: WriteRepository + cob::Store<Namespace = NodeId>>(
|
||||
repo: &R,
|
||||
) -> Result<IdentityMut<R>, RepositoryError> {
|
||||
) -> Result<IdentityMut<'_, R>, RepositoryError> {
|
||||
let oid = repo.identity_root()?;
|
||||
let oid = ObjectId::from(oid);
|
||||
|
||||
|
|
|
|||
|
|
@ -1390,7 +1390,7 @@ mod test {
|
|||
.create(
|
||||
cob::Title::new("My first issue").unwrap(),
|
||||
"Blah blah blah.",
|
||||
&[ux_label.clone()],
|
||||
std::slice::from_ref(&ux_label),
|
||||
&[],
|
||||
[],
|
||||
&node.signer,
|
||||
|
|
|
|||
|
|
@ -561,7 +561,7 @@ impl Patch {
|
|||
author: &'a PublicKey,
|
||||
) -> impl DoubleEndedIterator<Item = (RevisionId, &'a Revision)> {
|
||||
self.revisions()
|
||||
.filter(move |(_, r)| (r.author.public_key() == author))
|
||||
.filter(move |(_, r)| r.author.public_key() == author)
|
||||
}
|
||||
|
||||
/// List of patch reviews of the given revision.
|
||||
|
|
@ -2422,7 +2422,7 @@ where
|
|||
revision: RevisionId,
|
||||
commit: git::Oid,
|
||||
signer: &Device<G>,
|
||||
) -> Result<Merged<R>, Error>
|
||||
) -> Result<Merged<'_, R>, Error>
|
||||
where
|
||||
G: crypto::signature::Signer<crypto::Signature>,
|
||||
{
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ pub mod refs {
|
|||
///
|
||||
/// `refs/namespaces/<remote>/refs/rad/id`
|
||||
///
|
||||
pub fn id(remote: &RemoteId) -> Namespaced {
|
||||
pub fn id(remote: &RemoteId) -> Namespaced<'_> {
|
||||
IDENTITY_BRANCH.with_namespace(remote.into())
|
||||
}
|
||||
|
||||
|
|
@ -295,7 +295,7 @@ pub mod refs {
|
|||
///
|
||||
/// `refs/namespaces/<remote>/refs/rad/root`
|
||||
///
|
||||
pub fn id_root(remote: &RemoteId) -> Namespaced {
|
||||
pub fn id_root(remote: &RemoteId) -> Namespaced<'_> {
|
||||
IDENTITY_ROOT.with_namespace(remote.into())
|
||||
}
|
||||
|
||||
|
|
@ -304,7 +304,7 @@ pub mod refs {
|
|||
///
|
||||
/// `refs/namespaces/<remote>/refs/rad/sigrefs`
|
||||
///
|
||||
pub fn sigrefs(remote: &RemoteId) -> Namespaced {
|
||||
pub fn sigrefs(remote: &RemoteId) -> Namespaced<'_> {
|
||||
SIGREFS_BRANCH.with_namespace(remote.into())
|
||||
}
|
||||
|
||||
|
|
@ -488,7 +488,7 @@ pub fn remote_refs(url: &Url) -> Result<RandomMap<RemoteId, Refs>, ListRefsError
|
|||
/// The `T` can be specified when calling the function. For example, if you
|
||||
/// wanted to parse the namespace as a `PublicKey`, then you would the function
|
||||
/// like so, `parse_ref_namespaced::<PublicKey>(s)`.
|
||||
pub fn parse_ref_namespaced<T>(s: &str) -> Result<(T, fmt::Qualified), RefError>
|
||||
pub fn parse_ref_namespaced<T>(s: &str) -> Result<(T, fmt::Qualified<'_>), RefError>
|
||||
where
|
||||
T: FromStr,
|
||||
T::Err: std::error::Error + Send + Sync + 'static,
|
||||
|
|
@ -517,7 +517,7 @@ where
|
|||
/// The `T` can be specified when calling the function. For example, if you
|
||||
/// wanted to parse the namespace as a `PublicKey`, then you would the function
|
||||
/// like so, `parse_ref::<PublicKey>(s)`.
|
||||
pub fn parse_ref<T>(s: &str) -> Result<(Option<T>, fmt::Qualified), RefError>
|
||||
pub fn parse_ref<T>(s: &str) -> Result<(Option<T>, fmt::Qualified<'_>), RefError>
|
||||
where
|
||||
T: FromStr,
|
||||
T::Err: std::error::Error + Send + Sync + 'static,
|
||||
|
|
@ -590,7 +590,7 @@ pub fn empty_commit<'a>(
|
|||
}
|
||||
|
||||
/// Get the repository head.
|
||||
pub fn head(repo: &raw::Repository) -> Result<raw::Commit, raw::Error> {
|
||||
pub fn head(repo: &raw::Repository) -> Result<raw::Commit<'_>, raw::Error> {
|
||||
let head = repo.head()?.peel_to_commit()?;
|
||||
|
||||
Ok(head)
|
||||
|
|
|
|||
|
|
@ -514,7 +514,7 @@ pub struct MatchedRule<'a> {
|
|||
|
||||
impl MatchedRule<'_> {
|
||||
/// Return the reference name that was used for checking if it was a match.
|
||||
pub fn refname(&self) -> &Qualified {
|
||||
pub fn refname(&self) -> &Qualified<'_> {
|
||||
&self.refname
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ pub const MAX_STRING_LENGTH: usize = 255;
|
|||
pub const MAX_DELEGATES: usize = 255;
|
||||
/// The current, most recent version of the identity document.
|
||||
// SAFETY: identity version should never be 0, so we can use `unsafe` here
|
||||
pub const IDENTITY_VERSION: Version = Version(unsafe { NonZeroU32::new_unchecked(1) });
|
||||
pub const IDENTITY_VERSION: Version = Version(NonZeroU32::new(1).unwrap());
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
pub enum DocError {
|
||||
|
|
@ -827,7 +827,7 @@ impl Doc {
|
|||
pub(crate) fn blob_at<R: ReadRepository>(
|
||||
commit: Oid,
|
||||
repo: &R,
|
||||
) -> Result<git::raw::Blob, DocError> {
|
||||
) -> Result<git::raw::Blob<'_>, DocError> {
|
||||
let path = Path::new("embeds").join(*PATH);
|
||||
repo.blob_at(commit, path.as_path()).map_err(DocError::from)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -505,10 +505,10 @@ pub trait ReadRepository: Sized + ValidateRepository {
|
|||
&self,
|
||||
commit: Oid,
|
||||
path: P,
|
||||
) -> Result<crate::git::raw::Blob, crate::git::raw::Error>;
|
||||
) -> Result<crate::git::raw::Blob<'_>, crate::git::raw::Error>;
|
||||
|
||||
/// Get a blob in this repository, given its id.
|
||||
fn blob(&self, oid: Oid) -> Result<crate::git::raw::Blob, crate::git::raw::Error>;
|
||||
fn blob(&self, oid: Oid) -> Result<crate::git::raw::Blob<'_>, crate::git::raw::Error>;
|
||||
|
||||
/// Get the head of this repository.
|
||||
///
|
||||
|
|
@ -516,14 +516,14 @@ pub trait ReadRepository: Sized + ValidateRepository {
|
|||
/// head using [`ReadRepository::canonical_head`].
|
||||
///
|
||||
/// Returns the [`Oid`] as well as the qualified reference name.
|
||||
fn head(&self) -> Result<(Qualified, Oid), RepositoryError>;
|
||||
fn head(&self) -> Result<(Qualified<'_>, Oid), RepositoryError>;
|
||||
|
||||
/// Compute the canonical head of this repository.
|
||||
///
|
||||
/// Ignores any existing `HEAD` reference.
|
||||
///
|
||||
/// Returns the [`Oid`] as well as the qualified reference name.
|
||||
fn canonical_head(&self) -> Result<(Qualified, Oid), RepositoryError>;
|
||||
fn canonical_head(&self) -> Result<(Qualified<'_>, Oid), RepositoryError>;
|
||||
|
||||
/// Get the head of the `rad/id` reference in this repository.
|
||||
///
|
||||
|
|
@ -568,15 +568,15 @@ pub trait ReadRepository: Sized + ValidateRepository {
|
|||
&self,
|
||||
remote: &RemoteId,
|
||||
reference: &Qualified,
|
||||
) -> Result<crate::git::raw::Reference, crate::git::raw::Error>;
|
||||
) -> Result<crate::git::raw::Reference<'_>, crate::git::raw::Error>;
|
||||
|
||||
/// Get the [`crate::git::raw::Commit`] found using its `oid`.
|
||||
///
|
||||
/// Returns `Err` if the commit did not exist.
|
||||
fn commit(&self, oid: Oid) -> Result<crate::git::raw::Commit, crate::git::raw::Error>;
|
||||
fn commit(&self, oid: Oid) -> Result<crate::git::raw::Commit<'_>, crate::git::raw::Error>;
|
||||
|
||||
/// Perform a revision walk of a commit history starting from the given head.
|
||||
fn revwalk(&self, head: Oid) -> Result<crate::git::raw::Revwalk, crate::git::raw::Error>;
|
||||
fn revwalk(&self, head: Oid) -> Result<crate::git::raw::Revwalk<'_>, crate::git::raw::Error>;
|
||||
|
||||
/// Check if the underlying ODB contains the given `oid`.
|
||||
fn contains(&self, oid: Oid) -> Result<bool, crate::git::raw::Error>;
|
||||
|
|
@ -602,7 +602,7 @@ pub trait ReadRepository: Sized + ValidateRepository {
|
|||
fn references_glob(
|
||||
&self,
|
||||
pattern: &crate::git::fmt::refspec::PatternStr,
|
||||
) -> Result<Vec<(Qualified, Oid)>, crate::git::raw::Error>;
|
||||
) -> Result<Vec<(Qualified<'_>, Oid)>, crate::git::raw::Error>;
|
||||
|
||||
/// Get repository delegates.
|
||||
fn delegates(&self) -> Result<NonEmpty<Did>, RepositoryError> {
|
||||
|
|
|
|||
|
|
@ -667,7 +667,7 @@ impl ReadRepository for Repository {
|
|||
&self,
|
||||
commit_id: Oid,
|
||||
path: P,
|
||||
) -> Result<git::raw::Blob, git::raw::Error> {
|
||||
) -> Result<git::raw::Blob<'_>, git::raw::Error> {
|
||||
let commit = self.backend.find_commit(git::raw::Oid::from(commit_id))?;
|
||||
let tree = commit.tree()?;
|
||||
let entry = tree.get_path(path.as_ref())?;
|
||||
|
|
@ -683,7 +683,7 @@ impl ReadRepository for Repository {
|
|||
Ok(blob)
|
||||
}
|
||||
|
||||
fn blob(&self, oid: Oid) -> Result<git::raw::Blob, git::raw::Error> {
|
||||
fn blob(&self, oid: Oid) -> Result<git::raw::Blob<'_>, git::raw::Error> {
|
||||
self.backend.find_blob(oid.into())
|
||||
}
|
||||
|
||||
|
|
@ -691,7 +691,7 @@ impl ReadRepository for Repository {
|
|||
&self,
|
||||
remote: &RemoteId,
|
||||
name: &git::fmt::Qualified,
|
||||
) -> Result<git::raw::Reference, git::raw::Error> {
|
||||
) -> Result<git::raw::Reference<'_>, git::raw::Error> {
|
||||
let name = name.with_namespace(remote.into());
|
||||
self.backend.find_reference(&name)
|
||||
}
|
||||
|
|
@ -707,11 +707,11 @@ impl ReadRepository for Repository {
|
|||
Ok(oid.into())
|
||||
}
|
||||
|
||||
fn commit(&self, oid: Oid) -> Result<git::raw::Commit, git::raw::Error> {
|
||||
fn commit(&self, oid: Oid) -> Result<git::raw::Commit<'_>, git::raw::Error> {
|
||||
self.backend.find_commit(oid.into())
|
||||
}
|
||||
|
||||
fn revwalk(&self, head: Oid) -> Result<git::raw::Revwalk, git::raw::Error> {
|
||||
fn revwalk(&self, head: Oid) -> Result<git::raw::Revwalk<'_>, git::raw::Error> {
|
||||
let mut revwalk = self.backend.revwalk()?;
|
||||
revwalk.push(head.into())?;
|
||||
|
||||
|
|
@ -760,7 +760,7 @@ impl ReadRepository for Repository {
|
|||
fn references_glob(
|
||||
&self,
|
||||
pattern: &PatternStr,
|
||||
) -> Result<Vec<(Qualified, Oid)>, crate::git::raw::Error> {
|
||||
) -> Result<Vec<(Qualified<'_>, Oid)>, crate::git::raw::Error> {
|
||||
let mut refs = Vec::new();
|
||||
|
||||
for r in self.backend.references_glob(pattern)? {
|
||||
|
|
@ -785,7 +785,7 @@ impl ReadRepository for Repository {
|
|||
Doc::load_at(head, self)
|
||||
}
|
||||
|
||||
fn head(&self) -> Result<(Qualified, Oid), RepositoryError> {
|
||||
fn head(&self) -> Result<(Qualified<'_>, Oid), RepositoryError> {
|
||||
// If `HEAD` is already set locally, just return that.
|
||||
if let Ok(head) = self.backend.head() {
|
||||
if let Ok((name, oid)) = git::refs::qualified_from(&head) {
|
||||
|
|
@ -795,7 +795,7 @@ impl ReadRepository for Repository {
|
|||
self.canonical_head()
|
||||
}
|
||||
|
||||
fn canonical_head(&self) -> Result<(Qualified, Oid), RepositoryError> {
|
||||
fn canonical_head(&self) -> Result<(Qualified<'_>, Oid), RepositoryError> {
|
||||
let doc = self.identity_doc()?;
|
||||
let refname = git::refs::branch(doc.project()?.default_branch());
|
||||
let crefs = match doc.canonical_refs()? {
|
||||
|
|
|
|||
|
|
@ -277,11 +277,11 @@ impl<R: storage::ReadRepository> ReadRepository for DraftStore<'_, R> {
|
|||
self.repo.is_empty()
|
||||
}
|
||||
|
||||
fn head(&self) -> Result<(Qualified, Oid), RepositoryError> {
|
||||
fn head(&self) -> Result<(Qualified<'_>, Oid), RepositoryError> {
|
||||
self.repo.head()
|
||||
}
|
||||
|
||||
fn canonical_head(&self) -> Result<(Qualified, Oid), RepositoryError> {
|
||||
fn canonical_head(&self) -> Result<(Qualified<'_>, Oid), RepositoryError> {
|
||||
self.repo.canonical_head()
|
||||
}
|
||||
|
||||
|
|
@ -289,11 +289,11 @@ impl<R: storage::ReadRepository> ReadRepository for DraftStore<'_, R> {
|
|||
self.repo.path()
|
||||
}
|
||||
|
||||
fn commit(&self, oid: Oid) -> Result<git::raw::Commit, git::raw::Error> {
|
||||
fn commit(&self, oid: Oid) -> Result<git::raw::Commit<'_>, git::raw::Error> {
|
||||
self.repo.commit(oid)
|
||||
}
|
||||
|
||||
fn revwalk(&self, head: Oid) -> Result<git::raw::Revwalk, git::raw::Error> {
|
||||
fn revwalk(&self, head: Oid) -> Result<git::raw::Revwalk<'_>, git::raw::Error> {
|
||||
self.repo.revwalk(head)
|
||||
}
|
||||
|
||||
|
|
@ -309,11 +309,11 @@ impl<R: storage::ReadRepository> ReadRepository for DraftStore<'_, R> {
|
|||
&self,
|
||||
oid: Oid,
|
||||
path: P,
|
||||
) -> Result<git::raw::Blob, git::raw::Error> {
|
||||
) -> Result<git::raw::Blob<'_>, git::raw::Error> {
|
||||
self.repo.blob_at(oid, path)
|
||||
}
|
||||
|
||||
fn blob(&self, oid: Oid) -> Result<crate::git::raw::Blob, crate::git::raw::Error> {
|
||||
fn blob(&self, oid: Oid) -> Result<crate::git::raw::Blob<'_>, crate::git::raw::Error> {
|
||||
self.repo.blob(oid)
|
||||
}
|
||||
|
||||
|
|
@ -321,7 +321,7 @@ impl<R: storage::ReadRepository> ReadRepository for DraftStore<'_, R> {
|
|||
&self,
|
||||
remote: &RemoteId,
|
||||
reference: &git::fmt::Qualified,
|
||||
) -> Result<git::raw::Reference, git::raw::Error> {
|
||||
) -> Result<git::raw::Reference<'_>, git::raw::Error> {
|
||||
self.repo.reference(remote, reference)
|
||||
}
|
||||
|
||||
|
|
@ -340,7 +340,7 @@ impl<R: storage::ReadRepository> ReadRepository for DraftStore<'_, R> {
|
|||
fn references_glob(
|
||||
&self,
|
||||
pattern: &git::fmt::refspec::PatternStr,
|
||||
) -> Result<Vec<(fmt::Qualified, Oid)>, crate::git::raw::Error> {
|
||||
) -> Result<Vec<(fmt::Qualified<'_>, Oid)>, crate::git::raw::Error> {
|
||||
self.repo.references_glob(pattern)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -398,7 +398,7 @@ impl RefsAt {
|
|||
SignedRefsAt::load_at(self.at, self.remote, repo)
|
||||
}
|
||||
|
||||
pub fn path(&self) -> &git::fmt::Qualified {
|
||||
pub fn path(&self) -> &git::fmt::Qualified<'_> {
|
||||
&SIGREFS_BRANCH
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ pub fn tag(
|
|||
}
|
||||
|
||||
/// Populate a repository with commits, branches and blobs.
|
||||
pub fn populate(repo: &git::raw::Repository, scale: usize) -> Vec<git::fmt::Qualified> {
|
||||
pub fn populate(repo: &git::raw::Repository, scale: usize) -> Vec<git::fmt::Qualified<'_>> {
|
||||
assert!(
|
||||
scale <= 8,
|
||||
"Scale parameter must be less than or equal to 8"
|
||||
|
|
|
|||
|
|
@ -204,11 +204,11 @@ impl ReadRepository for MockRepository {
|
|||
Ok(self.remotes.is_empty())
|
||||
}
|
||||
|
||||
fn head(&self) -> Result<(fmt::Qualified, Oid), RepositoryError> {
|
||||
fn head(&self) -> Result<(fmt::Qualified<'_>, Oid), RepositoryError> {
|
||||
Ok((fmt::qualified!("refs/heads/master"), arbitrary::oid()))
|
||||
}
|
||||
|
||||
fn canonical_head(&self) -> Result<(fmt::Qualified, Oid), RepositoryError> {
|
||||
fn canonical_head(&self) -> Result<(fmt::Qualified<'_>, Oid), RepositoryError> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
|
|
@ -216,7 +216,7 @@ impl ReadRepository for MockRepository {
|
|||
todo!()
|
||||
}
|
||||
|
||||
fn commit(&self, oid: Oid) -> Result<git::raw::Commit, git::raw::Error> {
|
||||
fn commit(&self, oid: Oid) -> Result<git::raw::Commit<'_>, git::raw::Error> {
|
||||
Err(git::raw::Error::new(
|
||||
git::raw::ErrorCode::NotFound,
|
||||
git::raw::ErrorClass::None,
|
||||
|
|
@ -224,7 +224,7 @@ impl ReadRepository for MockRepository {
|
|||
))
|
||||
}
|
||||
|
||||
fn revwalk(&self, _head: Oid) -> Result<git::raw::Revwalk, git::raw::Error> {
|
||||
fn revwalk(&self, _head: Oid) -> Result<git::raw::Revwalk<'_>, git::raw::Error> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
|
|
@ -239,7 +239,7 @@ impl ReadRepository for MockRepository {
|
|||
Ok(true)
|
||||
}
|
||||
|
||||
fn blob(&self, _oid: Oid) -> Result<git::raw::Blob, git::raw::Error> {
|
||||
fn blob(&self, _oid: Oid) -> Result<git::raw::Blob<'_>, git::raw::Error> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
|
|
@ -247,7 +247,7 @@ impl ReadRepository for MockRepository {
|
|||
&self,
|
||||
_oid: Oid,
|
||||
_path: P,
|
||||
) -> Result<git::raw::Blob, git::raw::Error> {
|
||||
) -> Result<git::raw::Blob<'_>, git::raw::Error> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
|
|
@ -255,7 +255,7 @@ impl ReadRepository for MockRepository {
|
|||
&self,
|
||||
_remote: &RemoteId,
|
||||
_reference: &git::fmt::Qualified,
|
||||
) -> Result<git::raw::Reference, git::raw::Error> {
|
||||
) -> Result<git::raw::Reference<'_>, git::raw::Error> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
|
|
@ -287,7 +287,7 @@ impl ReadRepository for MockRepository {
|
|||
fn references_glob(
|
||||
&self,
|
||||
_pattern: &crate::git::fmt::refspec::PatternStr,
|
||||
) -> Result<Vec<(fmt::Qualified, Oid)>, crate::git::raw::Error> {
|
||||
) -> Result<Vec<(fmt::Qualified<'_>, Oid)>, crate::git::raw::Error> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue