Skip to content

Commit

Permalink
update deps and fix lints (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleades authored Sep 16, 2021
1 parent 6f05c83 commit 9035f67
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 37 deletions.
24 changes: 12 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ codecov = { repository = "Rust-Bucket/Crate-Index"}


[dependencies]
serde = { version = "1.0.117", features = ["derive"] }
url = { version = "2.2.0", features = ["serde"] }
semver = { version = "0.11.0", features = ["serde"] }
serde_json = "1.0.59"
async-std = "1.7.0"
thiserror = "1.0.22"
git2 = "0.13.12"
regex = "1.4.2"
serde = { version = "1.0.130", features = ["derive"] }
url = { version = "2.2.2", features = ["serde"] }
semver = { version = "1.0.4", features = ["serde"] }
serde_json = "1.0.68"
async-std = "1.10.0"
thiserror = "1.0.29"
git2 = "0.13.22"
regex = "1.5.4"
lazy_static = "1.4.0"
futures-util = "0.3.7"
futures-util = "0.3.17"

[features]
default = ["blocking"]
blocking = []

[dev-dependencies]
test-case = "1.0.0"
tempfile = "3.1.0"
async-std = { version = "1.7.0", features = ["attributes"] }
test-case = "1.2.0"
tempfile = "3.2.0"
async-std = { version = "1.10.0", features = ["attributes"] }
4 changes: 2 additions & 2 deletions src/blocking/index/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ mod tests {

// reopen the same tree and check crate is there
let tree = Tree::open(root).expect("couldn't open index tree");
assert!(tree.contains_crate("Some-Name"))
assert!(tree.contains_crate("Some-Name"));
}

#[test_case("Some-Name", "0.1.0"; "when crate exists and version exists")]
Expand All @@ -389,7 +389,7 @@ mod tests {
.expect("couldn't insert initial metadata");

if tree.yank(crate_name, &version).unwrap().is_err() {
panic!("not found")
panic!("not found");
}

tree.unyank(crate_name, &version).unwrap().unwrap();
Expand Down
4 changes: 2 additions & 2 deletions src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,10 @@ mod tests {
.expect("couldn't insert initial metadata");

if index.yank(crate_name, &version).await.unwrap().is_err() {
panic!("not found")
panic!("not found");
}

index.unyank(crate_name, &version).await.unwrap().unwrap();
})
});
}
}
16 changes: 8 additions & 8 deletions src/index/git.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![allow(clippy::clippy::missing_errors_doc)]
#![allow(clippy::missing_errors_doc)]

//! Abstractions over a git repository containing an index.
Expand Down Expand Up @@ -115,25 +115,25 @@ impl Repository {

fn merge(&self, commit: &git2::AnnotatedCommit) -> Result<(), git2::Error> {
// 1. do a merge analysis
let analysis = self.repo.merge_analysis(&[&commit])?;
let analysis = self.repo.merge_analysis(&[commit])?;

// 2. Do the appropriate merge
if analysis.0.is_fast_forward() {
// do a fast forward
let refname = "refs/heads/master";
if let Ok(mut r) = self.repo.find_reference(refname) {
fast_forward(&self.repo, &mut r, &commit)?;
fast_forward(&self.repo, &mut r, commit)?;
} else {
// The branch doesn't exist so just set the reference to the
// commit directly. Usually this is because you are pulling
// into an empty repository.
self.repo.reference(
&refname,
refname,
commit.id(),
true,
&format!("Setting {} to {}", "master", commit.id()),
)?;
self.repo.set_head(&refname)?;
self.repo.set_head(refname)?;
self.repo.checkout_head(Some(
git2::build::CheckoutBuilder::default()
.allow_conflicts(true)
Expand All @@ -146,7 +146,7 @@ impl Repository {
let head_commit = self
.repo
.reference_to_annotated_commit(&self.repo.head()?)?;
normal_merge(&self.repo, &head_commit, &commit)?;
normal_merge(&self.repo, &head_commit, commit)?;
} else {
}
Ok(())
Expand Down Expand Up @@ -254,7 +254,7 @@ mod tests {
local_repo.add_origin(&remote_path).unwrap();
local_repo.create_initial_commit().unwrap();
local_repo.pull().unwrap();
assert!(local_dir.path().join("some-file").exists())
assert!(local_dir.path().join("some-file").exists());
}

#[test]
Expand All @@ -279,6 +279,6 @@ mod tests {
local_repo.add_origin(&remote_path).unwrap();
local_repo.create_initial_commit().unwrap();
local_repo.pull().unwrap();
assert!(local_dir.path().join("some-file").exists())
assert!(local_dir.path().join("some-file").exists());
}
}
4 changes: 2 additions & 2 deletions src/index/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -571,10 +571,10 @@ mod tests {
.expect("couldn't insert initial metadata");

if tree.yank(crate_name, &version).await.unwrap().is_err() {
panic!("not found")
panic!("not found");
}

tree.unyank(crate_name, &version).await.unwrap().unwrap();
})
});
}
}
4 changes: 2 additions & 2 deletions src/index/tree/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ mod tests {
fn new() {
let url = "https://crates.io/api/v1/crates/{crate}/{version}/download";

let _ = Config::new(url);
Config::new(url);
}

#[test]
Expand All @@ -142,7 +142,7 @@ mod tests {
Config::new("https://my-crates-server.com/api/v1/crates/{crate}/{version}/download")
.with_crates_io_registry();

assert_eq!(config1, config2)
assert_eq!(config1, config2);
}

#[test]
Expand Down
4 changes: 2 additions & 2 deletions src/index/tree/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,10 @@ mod tests {
.expect("couldn't insert initial metadata");

if index_file.yank(&version).await.unwrap().is_err() {
panic!("version doesn't exist")
panic!("version doesn't exist");
}

index_file.unyank(&version).await.unwrap().unwrap();
})
});
}
}
6 changes: 3 additions & 3 deletions src/record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ mod tests {
let expected = r#"{"name":"foo","vers":"0.1.0","cksum":"d867001db0e2b6e0496f9fac96930e2d42233ecd3ca0413e0753d4c7695d289c"}"#.to_string();
let actual = metadata.to_string();

assert_eq!(expected, actual)
assert_eq!(expected, actual);
}

#[test]
Expand Down Expand Up @@ -239,7 +239,7 @@ mod tests {
}
"#;

let _: Record = serde_json::from_str(example1).unwrap();
serde_json::from_str::<Record>(example1).unwrap();

let example2 = r#"
{
Expand Down Expand Up @@ -273,7 +273,7 @@ mod tests {
}
"#;

let _: Record = serde_json::from_str(example2).unwrap();
serde_json::from_str::<Record>(example2).unwrap();
}

#[test]
Expand Down
8 changes: 4 additions & 4 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fn walk_dir(
if child.metadata().await?.is_dir() {
to_visit.push(child.path());
} else {
files.push(child)
files.push(child);
}
}

Expand Down Expand Up @@ -88,7 +88,7 @@ mod tests {

let result = async_std::task::block_on(crate_names(temp_dir.path())).unwrap();

assert_eq!(file_names, result)
assert_eq!(file_names, result);
}

#[test]
Expand All @@ -113,7 +113,7 @@ mod tests {

let result = async_std::task::block_on(crate_names(temp_dir.path())).unwrap();

assert_eq!(file_names, result)
assert_eq!(file_names, result);
}

#[test]
Expand All @@ -135,6 +135,6 @@ mod tests {

let result = async_std::task::block_on(crate_names(temp_dir.path())).unwrap();

assert_eq!(file_names, result)
assert_eq!(file_names, result);
}
}

0 comments on commit 9035f67

Please sign in to comment.