summaryrefslogtreecommitdiffstats
path: root/vendor/gix-refspec/src
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /vendor/gix-refspec/src
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix-refspec/src')
-rw-r--r--vendor/gix-refspec/src/match_group/mod.rs2
-rw-r--r--vendor/gix-refspec/src/match_group/validate.rs2
-rw-r--r--vendor/gix-refspec/src/parse.rs16
-rw-r--r--vendor/gix-refspec/src/spec.rs4
-rw-r--r--vendor/gix-refspec/src/write.rs4
5 files changed, 10 insertions, 18 deletions
diff --git a/vendor/gix-refspec/src/match_group/mod.rs b/vendor/gix-refspec/src/match_group/mod.rs
index c53b5b531..93d183230 100644
--- a/vendor/gix-refspec/src/match_group/mod.rs
+++ b/vendor/gix-refspec/src/match_group/mod.rs
@@ -43,7 +43,7 @@ impl<'a> MatchGroup<'a> {
push_unique(Mapping {
item_index: None,
lhs: SourceRef::ObjectId(id),
- rhs: m.rhs.map(|n| n.to_bstr()),
+ rhs: m.rhs.map(Needle::to_bstr),
spec_index: idx,
});
None
diff --git a/vendor/gix-refspec/src/match_group/validate.rs b/vendor/gix-refspec/src/match_group/validate.rs
index 097a64587..4bfca349e 100644
--- a/vendor/gix-refspec/src/match_group/validate.rs
+++ b/vendor/gix-refspec/src/match_group/validate.rs
@@ -79,7 +79,7 @@ impl std::fmt::Display for Error {
},
self.issues
.iter()
- .map(|issue| issue.to_string())
+ .map(ToString::to_string)
.collect::<Vec<_>>()
.join("\n\t")
)
diff --git a/vendor/gix-refspec/src/parse.rs b/vendor/gix-refspec/src/parse.rs
index 390db13fa..e957eee5f 100644
--- a/vendor/gix-refspec/src/parse.rs
+++ b/vendor/gix-refspec/src/parse.rs
@@ -25,7 +25,7 @@ pub enum Error {
#[error("Both sides of the specification need a pattern, like 'a/*:b/*'")]
PatternUnbalanced,
#[error(transparent)]
- ReferenceName(#[from] gix_validate::refname::Error),
+ ReferenceName(#[from] gix_validate::reference::name::Error),
#[error(transparent)]
RevSpec(#[from] gix_revision::spec::parse::Error),
}
@@ -151,7 +151,7 @@ pub(crate) mod function {
}
fn looks_like_object_hash(spec: &BStr) -> bool {
- spec.len() >= gix_hash::Kind::shortest().len_in_hex() && spec.iter().all(|b| b.is_ascii_hexdigit())
+ spec.len() >= gix_hash::Kind::shortest().len_in_hex() && spec.iter().all(u8::is_ascii_hexdigit)
}
fn validated(spec: Option<&BStr>, allow_revspecs: bool) -> Result<(Option<&BStr>, bool), Error> {
@@ -173,16 +173,8 @@ pub(crate) mod function {
.map_err(Error::from)
.or_else(|err| {
if allow_revspecs {
- match gix_revision::spec::parse(spec, &mut super::revparse::Noop) {
- Ok(_) => {
- if spec.iter().any(|b| b.is_ascii_whitespace()) {
- Err(err)
- } else {
- Ok(spec)
- }
- }
- Err(err) => Err(err.into()),
- }
+ gix_revision::spec::parse(spec, &mut super::revparse::Noop)?;
+ Ok(spec)
} else {
Err(err)
}
diff --git a/vendor/gix-refspec/src/spec.rs b/vendor/gix-refspec/src/spec.rs
index 43a5fce80..e6e39ddd7 100644
--- a/vendor/gix-refspec/src/spec.rs
+++ b/vendor/gix-refspec/src/spec.rs
@@ -14,8 +14,8 @@ impl RefSpec {
RefSpecRef {
mode: self.mode,
op: self.op,
- src: self.src.as_ref().map(|b| b.as_ref()),
- dst: self.dst.as_ref().map(|b| b.as_ref()),
+ src: self.src.as_ref().map(AsRef::as_ref),
+ dst: self.dst.as_ref().map(AsRef::as_ref),
}
}
diff --git a/vendor/gix-refspec/src/write.rs b/vendor/gix-refspec/src/write.rs
index 74c71c6e1..70036d864 100644
--- a/vendor/gix-refspec/src/write.rs
+++ b/vendor/gix-refspec/src/write.rs
@@ -14,7 +14,7 @@ impl RefSpecRef<'_> {
}
/// Serialize ourselves in a parseable format to `out`.
- pub fn write_to(&self, out: impl std::io::Write) -> std::io::Result<()> {
+ pub fn write_to(&self, out: &mut dyn std::io::Write) -> std::io::Result<()> {
self.instruction().write_to(out)
}
}
@@ -28,7 +28,7 @@ impl Instruction<'_> {
}
/// Serialize ourselves in a parseable format to `out`.
- pub fn write_to(&self, mut out: impl std::io::Write) -> std::io::Result<()> {
+ pub fn write_to(&self, out: &mut dyn std::io::Write) -> std::io::Result<()> {
match self {
Instruction::Push(Push::Matching {
src,