From e9291bb5f77ba08e7774f3c05b3fc8784bc3f798 Mon Sep 17 00:00:00 2001 From: Martin Algesten Date: Wed, 31 Jan 2024 10:08:22 +0100 Subject: [PATCH] MSRV 1.61 --- .github/workflows/test.yml | 21 +++++++ Cargo.lock | 118 ++++++++++++++----------------------- Cargo.toml | 4 +- src/header.rs | 10 ++-- 4 files changed, 71 insertions(+), 82 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3d6f86dc..08fa3c4a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,6 +41,27 @@ jobs: with: command: doc args: --no-deps --all-features --document-private-items + + build_versions: + strategy: + matrix: + rust: [stable, beta, 1.61.0] + runs-on: "ubuntu-latest" + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + - uses: Swatinem/rust-cache@v1 + - uses: actions-rs/cargo@v1 + with: + command: build + - uses: actions-rs/cargo@v1 + with: + command: build + build_and_test: name: Test runs-on: ubuntu-latest diff --git a/Cargo.lock b/Cargo.lock index ded1b63e..398dce71 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -33,51 +33,14 @@ dependencies = [ ] [[package]] -name = "anstream" -version = "0.6.11" +name = "atty" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2faccea4cc4ab4a667ce676a30e8ec13922a692c99bb8f5b11f1502c72e04220" - -[[package]] -name = "anstyle-parse" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" -dependencies = [ - "anstyle", - "windows-sys 0.52.0", + "hermit-abi", + "libc", + "winapi", ] [[package]] @@ -141,12 +104,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "colorchoice" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" - [[package]] name = "cookie" version = "0.17.0" @@ -218,27 +175,17 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "env_filter" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" -dependencies = [ - "log", - "regex", -] - [[package]] name = "env_logger" -version = "0.11.1" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05e7cf40684ae96ade6232ed84582f40ce0a66efcd43a5117aef610534f8e0b8" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" dependencies = [ - "anstream", - "anstyle", - "env_filter", + "atty", "humantime", "log", + "regex", + "termcolor", ] [[package]] @@ -314,11 +261,20 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + [[package]] name = "hoot" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf87063f47b6f7e47e6a187fcf6c545ebef7413a441a6d0c9cb83afe8734e43d" +checksum = "df22a4d90f1b0e65fe3e0d6ee6a4608cc4d81f4b2eb3e670f44bb6bde711e452" dependencies = [ "httparse", "log", @@ -326,9 +282,9 @@ dependencies = [ [[package]] name = "hootbin" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f740d734450d64288038db65cddfeda703a7d3865b2f0352ac61a2971433623f" +checksum = "354e60868e49ea1a39c44b9562ad207c4259dc6eabf9863bf3b0f058c55cfdb2" dependencies = [ "fastrand", "hoot", @@ -775,6 +731,15 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + [[package]] name = "thiserror" version = "1.0.56" @@ -868,7 +833,7 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "2.9.2" +version = "2.9.3" dependencies = [ "base64", "brotli-decompressor", @@ -906,12 +871,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "utf8parse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" - [[package]] name = "vcpkg" version = "0.2.15" @@ -955,6 +914,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +dependencies = [ + "winapi", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" diff --git a/Cargo.toml b/Cargo.toml index 3926f89c..c29912e5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -59,11 +59,11 @@ http-02 = { package = "http", version = "0.2", optional = true } http = { version = "1.0", optional = true } # This can't be in dev-dependencies due to doc tests. -hootbin = { version = "0.1.0" } +hootbin = { version = "0.1.1" } [dev-dependencies] serde = { version = "1", features = ["derive"] } -env_logger = "0.11.1" +env_logger = "<=0.9" rustls = { version = "0.22.0" } rustls-pemfile = { version = "2.0" } diff --git a/src/header.rs b/src/header.rs index 40a3fce6..053c8c5a 100644 --- a/src/header.rs +++ b/src/header.rs @@ -152,7 +152,7 @@ impl Header { } /// For non-utf8 headers this returns [`None`] (use [`get_header_raw()`]). -pub fn get_header<'h>(headers: &'h [Header], name: &str) -> Option<&'h str> { +pub(crate) fn get_header<'h>(headers: &'h [Header], name: &str) -> Option<&'h str> { headers .iter() .find(|h| h.is_name(name)) @@ -160,14 +160,14 @@ pub fn get_header<'h>(headers: &'h [Header], name: &str) -> Option<&'h str> { } #[allow(unused)] -pub fn get_header_raw<'h>(headers: &'h [Header], name: &str) -> Option<&'h [u8]> { +pub(crate) fn get_header_raw<'h>(headers: &'h [Header], name: &str) -> Option<&'h [u8]> { headers .iter() .find(|h| h.is_name(name)) .map(|h| h.value_raw()) } -pub fn get_all_headers<'h>(headers: &'h [Header], name: &str) -> Vec<&'h str> { +pub(crate) fn get_all_headers<'h>(headers: &'h [Header], name: &str) -> Vec<&'h str> { headers .iter() .filter(|h| h.is_name(name)) @@ -175,11 +175,11 @@ pub fn get_all_headers<'h>(headers: &'h [Header], name: &str) -> Vec<&'h str> { .collect() } -pub fn has_header(headers: &[Header], name: &str) -> bool { +pub(crate) fn has_header(headers: &[Header], name: &str) -> bool { get_header(headers, name).is_some() } -pub fn add_header(headers: &mut Vec
, header: Header) { +pub(crate) fn add_header(headers: &mut Vec
, header: Header) { let name = header.name(); if !name.starts_with("x-") && !name.starts_with("X-") { headers.retain(|h| h.name() != name);