Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update gix 0.70 #78

Merged
merged 2 commits into from
Jan 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
211 changes: 117 additions & 94 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ twox-hash = { version = "2.0", default-features = false, features = ["xxhash64"]

[dependencies.gix]
optional = true
version = "0.68"
version = "0.70"
default-features = false
features = []

Expand Down
7 changes: 4 additions & 3 deletions src/krate_name.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::error::{Error, InvalidKrateName};

#[cfg(test)]
/// Create a `KrateName` from a string literal.
#[macro_export]
macro_rules! kn {
($kn:literal) => {
Expand Down Expand Up @@ -200,7 +201,7 @@ impl<'name> TryFrom<&'name str> for KrateName<'name> {
}
}

impl<'name> KrateName<'name> {
impl KrateName<'_> {
/// Writes the crate's prefix to the specified string
///
/// Cargo uses a simple prefix in the registry index so that crate's can be
Expand Down Expand Up @@ -259,14 +260,14 @@ impl<'name> KrateName<'name> {

use std::fmt;

impl<'k> fmt::Display for KrateName<'k> {
impl fmt::Display for KrateName<'_> {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.0)
}
}

impl<'k> fmt::Debug for KrateName<'k> {
impl fmt::Debug for KrateName<'_> {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.0)
Expand Down
4 changes: 2 additions & 2 deletions src/utils/flock/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ pub(super) fn is_unsupported(err: &std::io::Error) -> bool {

#[inline]
pub(super) fn is_contended(err: &Error) -> bool {
err.raw_os_error().map_or(false, |x| x == libc::EWOULDBLOCK)
err.raw_os_error() == Some(libc::EWOULDBLOCK)
}

#[inline]
pub(super) fn is_timed_out(err: &Error) -> bool {
err.raw_os_error().map_or(false, |x| x == libc::EINTR)
err.raw_os_error() == Some(libc::EINTR)
}
13 changes: 5 additions & 8 deletions src/utils/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub fn write_fetch_head(
.mappings
.iter()
.find_map(|mapping| {
let gix::remote::fetch::Source::Ref(rref) = &mapping.remote else {
let gix::remote::fetch::refmap::Source::Ref(rref) = &mapping.remote else {
return None;
};

Expand Down Expand Up @@ -93,13 +93,10 @@ pub fn write_fetch_head(
}

rspec.local().map_or(false, |l| {
l.to_str()
.ok()
.and_then(|l| {
l.strip_prefix("refs/remotes/")
.and_then(|l| l.strip_suffix("/HEAD"))
})
.map_or(false, |remote| remote == remote_name)
l.to_str().ok().and_then(|l| {
l.strip_prefix("refs/remotes/")
.and_then(|l| l.strip_suffix("/HEAD"))
}) == Some(remote_name)
})
})
{
Expand Down
2 changes: 2 additions & 0 deletions tests/flock.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(missing_docs)]

use std::time::Duration;
use tame_index::utils::flock::LockOptions;

Expand Down
1 change: 1 addition & 0 deletions tests/git.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(missing_docs)]
#![cfg(feature = "__git")]

mod utils;
Expand Down
1 change: 1 addition & 0 deletions tests/local.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(missing_docs)]
#![cfg(all(feature = "local-builder", feature = "sparse"))]

mod utils;
Expand Down
2 changes: 2 additions & 0 deletions tests/sparse.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(missing_docs)]

mod utils;

use http::header;
Expand Down
1 change: 1 addition & 0 deletions tests/utils.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![allow(dead_code)]
#![allow(missing_docs)]

pub use tame_index::{IndexKrate, Path, PathBuf};

Expand Down