Merge remote-tracking branch 'origin/nix/rust-1.66'

* origin/nix/rust-1.66:
  surf: missed expect from refactoring diff
  nix: update to rust-1.66

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
This commit is contained in:
Fintan Halpenny
2022-12-16 11:37:10 +00:00
12 changed files with 20 additions and 20 deletions
+1 -1
View File
@@ -96,7 +96,7 @@ impl<'a> Qualified<'a> {
/// Add a namespace.
///
/// Creates a new [`Namespaced`] by prefxing `self` with
/// "refs/namespaces/<ns>".
/// `refs/namespaces/<ns>`.
pub fn with_namespace<'b>(&self, ns: Component<'b>) -> Namespaced<'a> {
Namespaced(Cow::Owned(
IntoIterator::into_iter([lit::Refs.into(), lit::Namespaces.into(), ns])
+1 -1
View File
@@ -345,7 +345,7 @@ impl<'a> QualifiedPattern<'a> {
/// Add a namespace.
///
/// Creates a new [`NamespacedPattern`] by prefxing `self` with
/// "refs/namespaces/<ns>".
/// `refs/namespaces/<ns>`.
pub fn with_namespace<'b>(
&self,
ns: Component<'b>,
+1 -1
View File
@@ -19,7 +19,7 @@ pub struct Service(pub GitService);
/// talking to an SSH remote. The `FromStr` implementation for this type expects
/// a string of the form:
///
/// <request type> /<path>
/// `<request type> /<path>`
///
/// Where the request type is either `upload-pack` or `receive-pack`, the
/// leading slash before the urn is optional, and the `path` is whatever the
+3 -3
View File
@@ -29,10 +29,10 @@
"homepage": "",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "cf668f737ac986c0a89e83b6b2e3c5ddbd8cf33b",
"sha256": "0xaswxxjkx5fjjl1c7gp27qajvpl9qsi0rmj044hhmjrrlpb6nvd",
"rev": "7da2f6b3a0c32f661cb2864d7fbd1d7e6f0c7543",
"sha256": "1daw246p4aimvx9h3cf034dsyimh9d2ww19v4fx45mcmlqw1mx42",
"type": "tarball",
"url": "https://github.com/oxalica/rust-overlay/archive/cf668f737ac986c0a89e83b6b2e3c5ddbd8cf33b.tar.gz",
"url": "https://github.com/oxalica/rust-overlay/archive/7da2f6b3a0c32f661cb2864d7fbd1d7e6f0c7543.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}
+3 -3
View File
@@ -283,7 +283,7 @@ impl<N, R> Reference<N, R, One> {
/// Build a reference that points to:
/// * `refs/namespaces/<namespace>/refs/heads/<name>`
/// * `refs/namespaces/<namespace>/refs/remote/<peer_id>/heads/<name>
/// * `refs/namespaces/<namespace>/refs/remote/<peer_id>/heads/<name>`
pub fn head(namespace: impl Into<Option<N>>, remote: impl Into<Option<R>>, name: One) -> Self {
Self {
remote: remote.into(),
@@ -295,7 +295,7 @@ impl<N, R> Reference<N, R, One> {
/// Build a reference that points to:
/// * `refs/namespaces/<namespace>/refs/tags/<name>`
/// * `refs/namespaces/<namespace>/refs/remote/<peer_id>/tags/<name>
/// * `refs/namespaces/<namespace>/refs/remote/<peer_id>/tags/<name>`
pub fn tag(namespace: impl Into<Option<N>>, remote: impl Into<Option<R>>, name: One) -> Self {
Self {
remote: remote.into(),
@@ -390,7 +390,7 @@ impl<N, R> Reference<N, R, Many> {
where
Self: ToString,
{
ext::References::from_globs(repo, &[self.to_string()])
ext::References::from_globs(repo, [self.to_string()])
}
/// Build a reference that points to:
+1 -1
View File
@@ -38,7 +38,7 @@ fn main() {
return;
},
};
let repo = Repository::discover(&repo_path).unwrap();
let repo = Repository::discover(repo_path).unwrap();
let now = Instant::now();
let head = repo.head().unwrap();
let root = repo.root_dir(head).unwrap();
+2 -2
View File
@@ -129,7 +129,7 @@ impl TryFrom<git2::Patch<'_>> for Hunks<Addition> {
}
impl TryFrom<git2::Patch<'_>> for Hunks<Deletion> {
type Error = git2::Error;
type Error = error::Deletion;
fn try_from(patch: git2::Patch) -> Result<Self, Self::Error> {
let mut hunks = Vec::with_capacity(patch.num_hunks());
@@ -140,7 +140,7 @@ impl TryFrom<git2::Patch<'_>> for Hunks<Deletion> {
for l in 0..hunk_lines {
let line = patch.line_in_hunk(h, l)?;
lines.push(Deletion::try_from(line).expect("TODO"));
lines.push(Deletion::try_from(line)?);
}
hunks.push(Hunk { header, lines })
}
+2 -2
View File
@@ -16,7 +16,7 @@ mod directory {
#[test]
fn directory_find_entry() {
let repo = Repository::open(GIT_PLATINUM).unwrap();
let root = repo.root_dir(&Branch::local(refname!("master"))).unwrap();
let root = repo.root_dir(Branch::local(refname!("master"))).unwrap();
// find_entry for a file.
let path = Path::new("src/memory.rs");
@@ -95,7 +95,7 @@ mod directory {
#[test]
fn directory_size() {
let repo = Repository::open(GIT_PLATINUM).unwrap();
let root = repo.root_dir(&Branch::local(refname!("master"))).unwrap();
let root = repo.root_dir(Branch::local(refname!("master"))).unwrap();
/*
git-platinum (master) $ ls -l src
+2 -2
View File
@@ -12,7 +12,7 @@ use super::GIT_PLATINUM;
fn iterate_root_dir_recursive() {
let repo = Repository::open(GIT_PLATINUM).unwrap();
let root_dir = repo.root_dir(&Branch::local(refname!("master"))).unwrap();
let root_dir = repo.root_dir(Branch::local(refname!("master"))).unwrap();
let count = println_dir(&root_dir, &repo);
assert_eq!(count, 36); // Check total file count.
@@ -42,7 +42,7 @@ fn iterate_root_dir_recursive() {
fn browse_repo_lazily() {
let repo = Repository::open(GIT_PLATINUM).unwrap();
let root_dir = repo.root_dir(&Branch::local(refname!("master"))).unwrap();
let root_dir = repo.root_dir(Branch::local(refname!("master"))).unwrap();
let count = root_dir.entries(&repo).unwrap().entries().count();
assert_eq!(count, 8);
let count = traverse(&root_dir, &repo);
+2 -2
View File
@@ -116,8 +116,8 @@ fn test_diff() -> Result<(), Error> {
fn test_branch_diff() -> Result<(), Error> {
let repo = Repository::open(GIT_PLATINUM)?;
let diff = repo.diff(
&Branch::local(refname!("master")),
&Branch::local(refname!("dev")),
Branch::local(refname!("master")),
Branch::local(refname!("dev")),
)?;
println!("Diff two branches: master -> dev");
+1 -1
View File
@@ -103,7 +103,7 @@ fn root() {
.expect("Could not retrieve ./data/git-platinum as git repository");
let rev = Branch::local(refname!("master"));
let root_last_commit_id = repo
.last_commit(&PathBuf::new(), &rev)
.last_commit(PathBuf::new(), rev)
.expect("Failed to get last commit")
.map(|commit| commit.id);
+1 -1
View File
@@ -6,5 +6,5 @@ fn test_submodule_failure() {
use radicle_surf::git::{Branch, Repository};
let repo = Repository::discover(".").unwrap();
repo.root_dir(&Branch::local(refname!("main"))).unwrap();
repo.root_dir(Branch::local(refname!("main"))).unwrap();
}