From f620748f25aabf6273e79128b1a2b915b3fa48a4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Jun 2022 23:52:30 +0200 Subject: [PATCH 1/6] Bump reqwest from 0.11.10 to 0.11.11 (#651) Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.11.10 to 0.11.11. - [Release notes](https://github.com/seanmonstar/reqwest/releases) - [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md) - [Commits](https://github.com/seanmonstar/reqwest/compare/v0.11.10...v0.11.11) --- updated-dependencies: - dependency-name: reqwest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 120 +++++++++++++++++++++++------- examples/builder/Cargo.toml | 2 +- examples/collect_links/Cargo.toml | 2 +- lychee-bin/Cargo.toml | 2 +- lychee-lib/Cargo.toml | 2 +- 5 files changed, 99 insertions(+), 29 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f70dbf1..3981fba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -267,7 +267,7 @@ dependencies = [ "futures-io", "futures-util", "pin-utils", - "trust-dns-resolver", + "trust-dns-resolver 0.20.4", ] [[package]] @@ -525,7 +525,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "trust-dns-proto", + "trust-dns-proto 0.20.4", ] [[package]] @@ -964,6 +964,18 @@ dependencies = [ "syn", ] +[[package]] +name = "enum-as-inner" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21cdad81446a7f7dc43f6a77409efeb9733d2fa65553efef6018ef257c959b73" +dependencies = [ + "heck 0.4.0", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "event-listener" version = "2.5.2" @@ -1274,7 +1286,7 @@ dependencies = [ "indexmap", "slab", "tokio", - "tokio-util 0.7.2", + "tokio-util", "tracing", ] @@ -1580,11 +1592,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7e2f18aece9709094573a9f24f483c4f65caa4298e2f7ae1b71cc65d853fad7" dependencies = [ "socket2 0.3.19", - "widestring", + "widestring 0.4.3", "winapi", "winreg 0.6.2", ] +[[package]] +name = "ipconfig" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "723519edce41262b05d4143ceb95050e4c614f483e78e9fd9e39a8275a84ad98" +dependencies = [ + "socket2 0.4.4", + "widestring 0.5.1", + "winapi", + "winreg 0.7.0", +] + [[package]] name = "ipnet" version = "2.5.0" @@ -2610,9 +2634,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.10" +version = "0.11.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46a1f7aa4f35e5e8b4160449f51afc758f0ce6454315a9fa7d0d113e958c41eb" +checksum = "b75aa69a3f06bbcc66ede33af2af253c6f7a86b1ca0033f60c580a27074fbf92" dependencies = [ "async-compression", "base64", @@ -2639,8 +2663,9 @@ dependencies = [ "tokio", "tokio-native-tls", "tokio-socks", - "tokio-util 0.6.10", - "trust-dns-resolver", + "tokio-util", + "tower-service", + "trust-dns-resolver 0.21.2", "url", "wasm-bindgen", "wasm-bindgen-futures", @@ -3290,20 +3315,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "log", - "pin-project-lite", - "tokio", -] - [[package]] name = "tokio-util" version = "0.7.2" @@ -3390,7 +3401,32 @@ dependencies = [ "async-trait", "cfg-if", "data-encoding", - "enum-as-inner", + "enum-as-inner 0.3.4", + "futures-channel", + "futures-io", + "futures-util", + "idna", + "ipnet", + "lazy_static", + "log", + "rand 0.8.5", + "smallvec", + "thiserror", + "tinyvec", + "tokio", + "url", +] + +[[package]] +name = "trust-dns-proto" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c31f240f59877c3d4bb3b3ea0ec5a6a0cff07323580ff8c7a605cd7d08b255d" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner 0.4.0", "futures-channel", "futures-io", "futures-util", @@ -3414,7 +3450,7 @@ checksum = "ecae383baad9995efaa34ce8e57d12c3f305e545887472a492b838f4b5cfb77a" dependencies = [ "cfg-if", "futures-util", - "ipconfig", + "ipconfig 0.2.2", "lazy_static", "log", "lru-cache", @@ -3422,8 +3458,27 @@ dependencies = [ "resolv-conf", "smallvec", "thiserror", + "trust-dns-proto 0.20.4", +] + +[[package]] +name = "trust-dns-resolver" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4ba72c2ea84515690c9fcef4c6c660bb9df3036ed1051686de84605b74fd558" +dependencies = [ + "cfg-if", + "futures-util", + "ipconfig 0.3.0", + "lazy_static", + "log", + "lru-cache", + "parking_lot 0.12.0", + "resolv-conf", + "smallvec", + "thiserror", "tokio", - "trust-dns-proto", + "trust-dns-proto 0.21.2", ] [[package]] @@ -3710,6 +3765,12 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c168940144dd21fd8046987c16a46a33d5fc84eec29ef9dcddc2ac9e31526b7c" +[[package]] +name = "widestring" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" + [[package]] name = "winapi" version = "0.3.9" @@ -3793,6 +3854,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "winreg" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" +dependencies = [ + "winapi", +] + [[package]] name = "winreg" version = "0.10.1" diff --git a/examples/builder/Cargo.toml b/examples/builder/Cargo.toml index 61bc0c1..96e5f04 100644 --- a/examples/builder/Cargo.toml +++ b/examples/builder/Cargo.toml @@ -12,4 +12,4 @@ lychee-lib = { path = "../../lychee-lib", version = "0.10.0" } tokio = { version = "1.19.2", features = ["full"] } regex = "1.5.6" http = "0.2.8" -reqwest = { version = "0.11.10", features = ["gzip"] } +reqwest = { version = "0.11.11", features = ["gzip"] } diff --git a/examples/collect_links/Cargo.toml b/examples/collect_links/Cargo.toml index 27c8b45..50865a9 100644 --- a/examples/collect_links/Cargo.toml +++ b/examples/collect_links/Cargo.toml @@ -13,4 +13,4 @@ tokio = { version = "1.19.2", features = ["full"] } regex = "1.5.6" http = "0.2.8" tokio-stream = "0.1.9" -reqwest = { version = "0.11.10", features = ["gzip"] } +reqwest = { version = "0.11.11", features = ["gzip"] } diff --git a/lychee-bin/Cargo.toml b/lychee-bin/Cargo.toml index 299abf4..508078e 100644 --- a/lychee-bin/Cargo.toml +++ b/lychee-bin/Cargo.toml @@ -27,7 +27,7 @@ indicatif = "0.16.2" openssl-sys = "0.9.74" pad = "0.1.6" regex = "1.5.6" -reqwest = { version = "0.11.10", features = ["gzip"] } +reqwest = { version = "0.11.11", features = ["gzip"] } # Make build work on Apple Silicon. # See https://github.com/briansmith/ring/issues/1163 # This is necessary for the homebrew build diff --git a/lychee-lib/Cargo.toml b/lychee-lib/Cargo.toml index c9c8084..b6807f9 100644 --- a/lychee-lib/Cargo.toml +++ b/lychee-lib/Cargo.toml @@ -27,7 +27,7 @@ pulldown-cmark = "0.9.1" regex = "1.5.6" # Use trust-dns to avoid lookup failures on high concurrency # https://github.com/seanmonstar/reqwest/issues/296 -reqwest = { version = "0.11.10", features = ["gzip", "trust-dns"] } +reqwest = { version = "0.11.11", features = ["gzip", "trust-dns"] } # Make build work on Apple Silicon. # See https://github.com/briansmith/ring/issues/1163 # This is necessary for the homebrew build From 2730e716562056efcdd1a1226a5785c27b2138b0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Jun 2022 12:43:04 +0200 Subject: [PATCH 2/6] Bump cached from 0.34.0 to 0.34.1 (#650) Bumps [cached](https://github.com/jaemk/cached) from 0.34.0 to 0.34.1. - [Release notes](https://github.com/jaemk/cached/releases) - [Changelog](https://github.com/jaemk/cached/blob/master/CHANGELOG.md) - [Commits](https://github.com/jaemk/cached/commits) --- updated-dependencies: - dependency-name: cached dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- lychee-lib/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3981fba..6a28994 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -450,9 +450,9 @@ checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" [[package]] name = "cached" -version = "0.34.0" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aadf76ddea74bab35ebeb8f1eb115b9bc04eaee42d8acc0d5f477dee6b176c9a" +checksum = "12f5cd208ba696f870238022d81ca1d80ed9d696fd62341c747f2d8f6ecdd9fe" dependencies = [ "async-trait", "async_once", diff --git a/lychee-lib/Cargo.toml b/lychee-lib/Cargo.toml index b6807f9..690f126 100644 --- a/lychee-lib/Cargo.toml +++ b/lychee-lib/Cargo.toml @@ -43,7 +43,7 @@ path-clean = "0.1.0" percent-encoding = "2.1.0" async-stream = "0.3.3" jwalk = "0.6.0" -cached = "0.34.0" +cached = "0.34.1" once_cell = "1.12.0" thiserror = "1.0.31" futures = "0.3.21" From 0f2ce778b436ea5094e080141c6cd55dc5c8fedf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Jun 2022 12:43:28 +0200 Subject: [PATCH 3/6] Bump uuid from 1.1.1 to 1.1.2 (#649) Bumps [uuid](https://github.com/uuid-rs/uuid) from 1.1.1 to 1.1.2. - [Release notes](https://github.com/uuid-rs/uuid/releases) - [Commits](https://github.com/uuid-rs/uuid/compare/1.1.1...1.1.2) --- updated-dependencies: - dependency-name: uuid dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- lychee-bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6a28994..cde2925 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3579,9 +3579,9 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "uuid" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6d5d669b51467dcf7b2f1a796ce0f955f05f01cafda6c19d6e95f730df29238" +checksum = "dd6469f4314d5f1ffec476e05f17cc9a78bc7a27a6a857842170bdf8d6f98d2f" dependencies = [ "getrandom 0.2.6", ] diff --git a/lychee-bin/Cargo.toml b/lychee-bin/Cargo.toml index 508078e..6a635d3 100644 --- a/lychee-bin/Cargo.toml +++ b/lychee-bin/Cargo.toml @@ -54,7 +54,7 @@ log = "0.4.17" assert_cmd = "2.0.4" predicates = "2.1.1" tempfile = "3.3.0" -uuid = { version = "1.1.1", features = ["v4"] } +uuid = { version = "1.1.2", features = ["v4"] } wiremock = "0.5.13" tracing-subscriber = { version = "0.3.11", default-features = false, features = ["fmt", "registry", "env-filter"] } From 17a6db64b23739916347688de7e1a8567fec11a5 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 17 Jun 2022 12:43:48 +0200 Subject: [PATCH 4/6] Add basic codespaces setup (#654) --- .devcontainer/Dockerfile | 4 +++ .devcontainer/devcontainer.json | 57 +++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..65d3c06 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,4 @@ +# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.236.0/containers/rust/.devcontainer/base.Dockerfile +# [Choice] Debian OS version (use bullseye on local arm64/Apple Silicon): buster, bullseye +ARG VARIANT="buster" +FROM mcr.microsoft.com/vscode/devcontainers/rust:0-${VARIANT} \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..b838ff2 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,57 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.236.0/containers/rust +{ + "name": "Rust", + "build": { + "dockerfile": "Dockerfile", + "args": { + // Use the VARIANT arg to pick a Debian OS version: buster, bullseye + // Use bullseye when on local on arm64/Apple Silicon. + "VARIANT": "bullseye" + } + }, + "runArgs": [ + "--cap-add=SYS_PTRACE", + "--security-opt", + "seccomp=unconfined" + ], + + // Configure tool-specific properties. + "customizations": { + // Configure properties specific to VS Code. + "vscode": { + // Set *default* container specific settings.json values on container create. + "settings": { + "lldb.executable": "/usr/bin/lldb", + // VS Code don't watch files under ./target + "files.watcherExclude": { + "**/target/**": true + }, + "rust-analyzer.checkOnSave.command": "clippy" + }, + + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "vadimcn.vscode-lldb", + "mutantdino.resourcemonitor", + "matklad.rust-analyzer", + "tamasfe.even-better-toml", + "serayuzgur.crates", + "vscodevim.vim" + ] + } + }, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "rustc --version", + + // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "vscode", + "features": { + "git": "latest", + "github-cli": "latest" + } +} From f1ae22da09c2ef200bc427f2bfe7c1c1066ee56e Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Sat, 18 Jun 2022 19:00:07 +0200 Subject: [PATCH 5/6] Replace lazy hashset with matches! (#656) * Replace lazy hashset with matches! llvm will typically create much faster code than accessing a hashset at runtime source: trust me bro * cargo fix * cargo fmt * shorten docstring --- lychee-lib/src/extract/mod.rs | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/lychee-lib/src/extract/mod.rs b/lychee-lib/src/extract/mod.rs index b051cf6..1c41666 100644 --- a/lychee-lib/src/extract/mod.rs +++ b/lychee-lib/src/extract/mod.rs @@ -1,5 +1,3 @@ -use std::collections::HashSet; - use crate::types::{uri::raw::RawUri, FileType, InputContent}; mod html5ever; @@ -8,26 +6,16 @@ mod markdown; mod plaintext; use markdown::extract_markdown; -use once_cell::sync::Lazy; use plaintext::extract_plaintext; -/// HTML elements that are deemed verbatim (i.e. preformatted). +/// Check if the given element is in the list of preformatted ("verbatim") tags. +/// /// These will be excluded from link checking by default. -static VERBATIM_ELEMENTS: Lazy> = Lazy::new(|| { - HashSet::from_iter([ - "pre".into(), - "code".into(), - "textarea".into(), - "samp".into(), - "xmp".into(), - "plaintext".into(), - "listing".into(), - ]) -}); - -/// Check if the given element is in the list of preformatted tags pub(crate) fn is_verbatim_elem(name: &str) -> bool { - VERBATIM_ELEMENTS.contains(name) + matches!( + name, + "pre" | "code" | "textarea" | "samp" | "xmp" | "plaintext" | "listing" + ) } /// A handler for extracting links from various input formats like Markdown and From 1fa19df4bdc18b97ab5073f58bfa17ebf831ac73 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Jun 2022 16:54:27 +0200 Subject: [PATCH 6/6] Bump anyhow from 1.0.57 to 1.0.58 (#657) Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.57 to 1.0.58. - [Release notes](https://github.com/dtolnay/anyhow/releases) - [Commits](https://github.com/dtolnay/anyhow/compare/1.0.57...1.0.58) --- updated-dependencies: - dependency-name: anyhow dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- lychee-bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cde2925..34cc9bf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -37,9 +37,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.57" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc" +checksum = "bb07d2053ccdbe10e2af2995a2f116c1330396493dc1269f6a91d0ae82e19704" [[package]] name = "arc-swap" diff --git a/lychee-bin/Cargo.toml b/lychee-bin/Cargo.toml index 6a635d3..725ff0c 100644 --- a/lychee-bin/Cargo.toml +++ b/lychee-bin/Cargo.toml @@ -18,7 +18,7 @@ version = "0.10.0" [dependencies] lychee-lib = { path = "../lychee-lib", version = "0.10.0", default-features = false } -anyhow = "1.0.57" +anyhow = "1.0.58" console = "0.15.0" const_format = "0.2.24" headers = "0.3.7"