Skip to content

Commit

Permalink
CheckContext -> &CheckContext
Browse files Browse the repository at this point in the history
  • Loading branch information
jyn514 committed Nov 24, 2020
1 parent 567c551 commit c8e1488
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@

* Warnings from cargo are no longer silenced when documenting. [PR#114]

#### Changed

* `walk_dir` now takes `&CheckContext`, not `CheckContext`. [PR#118]

[PR#114]: https://github.com/deadlinks/cargo-deadlinks/pull/114
[PR#118]: https://github.com/deadlinks/cargo-deadlinks/pull/118

<a name="0.6.1"></a>
## 0.6.1 (2020-11-23)
Expand Down
2 changes: 1 addition & 1 deletion src/bin/cargo-deadlinks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fn main() {
}
};
log::info!("checking directory {:?}", dir);
if walk_dir(&dir, ctx.clone()) {
if walk_dir(&dir, &ctx) {
errors = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/bin/deadlinks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fn main() {
}
};
log::info!("checking directory {:?}", dir);
if walk_dir(&dir, args.into()) {
if walk_dir(&dir, &args.into()) {
process::exit(1);
}
}
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ impl fmt::Display for FileError {
///
/// For each error that occurred, print an error message.
/// Returns whether an error occurred.
pub fn walk_dir(dir_path: &Path, ctx: CheckContext) -> bool {
pub fn walk_dir(dir_path: &Path, ctx: &CheckContext) -> bool {
let pool = ThreadPoolBuilder::new()
.num_threads(num_cpus::get())
.build()
.unwrap();

pool.install(|| {
unavailable_urls(dir_path, &ctx)
unavailable_urls(dir_path, ctx)
.map(|err| {
if ctx.verbose {
println!("{}", err);
Expand Down

0 comments on commit c8e1488

Please sign in to comment.