Snap for 8730993 from fc3fecda029e1b47febb85116e64b886da4ce1a5 to mainline-tzdata3-release

Change-Id: If1b3a7243d6d3b4e6665bdef0830583e63ec0ba9
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 40e1b5b..b30c393 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,5 @@
 {
   "git": {
-    "sha1": "4e773a3b8523a73e7105e11f0b2d4b545827712e"
+    "sha1": "1bf6f4badbddd98fc7b667d310605c5a204bc8e4"
   }
 }
diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml
deleted file mode 100755
index 118008c..0000000
--- a/.github/workflows/audit.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-name: Security audit
-on:
-  push:
-    paths: 
-      - '**/Cargo.toml'
-      - '**/Cargo.lock'
-jobs:
-  security_audit:
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v1
-      - uses: actions-rs/audit-check@v1
-        with:
-          token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
deleted file mode 100755
index 2c39904..0000000
--- a/.github/workflows/ci.yaml
+++ /dev/null
@@ -1,54 +0,0 @@
-on:
-  push:
-    branches:
-      - master
-  pull_request:
-    branches:
-      - master
-
-name: tests
-
-jobs:
-  ci:
-    runs-on: ubuntu-latest
-    strategy:
-      matrix:
-        rust:
-          - stable
-          - beta
-          - nightly
-          - 1.46.0  # MSRV
-
-    steps:
-      - uses: actions/checkout@v2
-
-      - uses: actions-rs/toolchain@v1
-        with:
-          profile: minimal
-          toolchain: ${{ matrix.rust }}
-          override: true
-          components: rustfmt, clippy
-
-      - uses: Swatinem/rust-cache@v1
-
-      - uses: actions-rs/cargo@v1
-        with:
-          command: build
-          args: --features stable
-
-      - uses: actions-rs/cargo@v1
-        with:
-          command: test
-          args: --features stable
-
-      - uses: actions-rs/cargo@v1
-        if: ${{ matrix.rust == 'stable' }}
-        with:
-          command: fmt
-          args: --all -- --check
-
-      - uses: actions-rs/cargo@v1
-        if: ${{ matrix.rust != '1.40.0' }} # 1.40 has horrible lints.
-        with:
-          command: clippy
-          args: -- -D warnings
diff --git a/.travis.yml b/.travis.yml
new file mode 100755
index 0000000..d67d8fa
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,87 @@
+sudo: false
+
+language: rust
+
+cache: cargo
+
+rust:
+  - stable
+
+os:
+  - linux
+  - osx
+
+matrix:
+  include:
+    - os: linux
+      env: GNUPLOT=yes
+      addons:
+        apt:
+          packages:
+            - gnuplot
+    - os: linux
+      env: CLIPPY=yes
+      rust: stable
+    - os: linux
+      env: RUSTFMT=yes
+      rust: stable
+    - os: linux
+      env: DOCS=yes
+    - os: linux
+      env: GNUPLOT=yes
+      rust: 1.39.0
+      addons:
+        apt:
+          packages:
+            - gnuplot
+    - os: linux
+      env: GNUPLOT=no
+      rust: nightly
+    - os: linux
+      env: GNUPLOT=yes
+      rust: nightly
+      addons:
+        apt:
+          packages:
+            - gnuplot
+    - os: osx
+      env: GNUPLOT=yes
+    - os: osx
+      env: GNUPLOT=no
+      rust: nightly
+    - os: osx
+      env: GNUPLOT=yes
+      rust: nightly
+    - os: linux
+      env: MINIMAL_VERSIONS=yes
+      rust: nightly
+
+before_script:
+  - if [ "$DOCS" = "yes" ]; then
+      pip install 'travis-cargo<0.2' --user;
+      export PATH=$HOME/.local/bin:$PATH;
+    fi
+
+before_cache:
+- find ./target/debug -maxdepth 1 -type f -delete
+- rm -rf ./target/debug/deps/criterion*
+- rm -rf ./target/debug/deps/bench*
+- rm -rf ./target/debug/.fingerprint/criterion*
+- rm -rf ./target/debug/.fingerprint/bench*
+- rm -f  ./target/.rustc_info.json
+- rm -rf ./target/criterion
+- rm -rf ~/.cargo/registry/index/
+
+install:
+  - sh ci/install.sh
+
+script:
+  - sh ci/script.sh
+
+env:
+  global:
+    - secure: "f/HaMzQu7d6ochSjE5lUjJbXYWlhbzslyTuWq+Lub/r2TTL4hVlT9koC4RT7W73V3WDrwYIqEGmwvscVffnijZRebl/PV+6WlOlYJEdAgKxGROpFGDIJGRGAc/f3s6OcJ+Hr8rmRF70fYEl45hs6J53X8s+CVRuty+r/UdilRpM="
+
+notifications:
+  email:
+    on_success: never
diff --git a/Android.bp b/Android.bp
index f63d8a9..5338905 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,4 +1,4 @@
-// This file is generated by cargo2android.py --config cargo2android.json.
+// This file is generated by cargo2android.py --run --device --dependencies.
 // Do not modify this file as changes will be overridden on upgrade.
 
 package {
@@ -39,11 +39,8 @@
 
 rust_library {
     name: "libcriterion",
-    // has rustc warnings
     host_supported: true,
     crate_name: "criterion",
-    cargo_env_compat: true,
-    cargo_pkg_version: "0.3.5",
     srcs: ["src/lib.rs"],
     edition: "2018",
     features: [
@@ -71,3 +68,58 @@
     ],
     proc_macros: ["libserde_derive"],
 }
+
+// dependent_library ["feature_list"]
+//   atty-0.2.14
+//   autocfg-1.0.1
+//   bitflags-1.2.1 "default"
+//   bstr-0.2.15 "default,lazy_static,regex-automata,serde,serde1,serde1-nostd,std,unicode"
+//   byteorder-1.4.3
+//   cast-0.2.3 "default,std"
+//   cfg-if-1.0.0
+//   clap-2.33.3
+//   criterion-plot-0.4.3
+//   crossbeam-channel-0.5.0 "crossbeam-utils,default,std"
+//   crossbeam-deque-0.8.0 "crossbeam-epoch,crossbeam-utils,default,std"
+//   crossbeam-epoch-0.9.3 "alloc,lazy_static,std"
+//   crossbeam-utils-0.8.3 "default,lazy_static,std"
+//   csv-1.1.6
+//   csv-core-0.1.10 "default"
+//   either-1.6.1
+//   half-1.7.1
+//   itertools-0.10.0 "default,use_alloc,use_std"
+//   itertools-0.9.0 "default,use_std"
+//   itoa-0.4.7 "default,std"
+//   lazy_static-1.4.0
+//   libc-0.2.92 "default,std"
+//   memchr-2.3.4 "default,std,use_std"
+//   memoffset-0.6.3 "default"
+//   num-traits-0.2.14 "default,std"
+//   num_cpus-1.13.0
+//   oorandom-11.1.3
+//   plotters-0.3.0 "area_series,line_series,plotters-svg,svg_backend"
+//   plotters-backend-0.3.0
+//   plotters-svg-0.3.0
+//   proc-macro2-1.0.26 "default,proc-macro"
+//   quote-1.0.9 "default,proc-macro"
+//   rayon-1.5.0
+//   rayon-core-1.9.0
+//   regex-1.4.5 "std"
+//   regex-automata-0.1.9
+//   regex-syntax-0.6.23
+//   rustc_version-0.2.3
+//   ryu-1.0.5
+//   same-file-1.0.6
+//   scopeguard-1.1.0
+//   semver-0.9.0 "default"
+//   semver-parser-0.7.0
+//   serde-1.0.125 "default,std"
+//   serde_cbor-0.11.1 "default,std"
+//   serde_derive-1.0.125 "default"
+//   serde_json-1.0.64 "default,std"
+//   syn-1.0.68 "clone-impls,default,derive,full,parsing,printing,proc-macro,quote,visit"
+//   textwrap-0.11.0
+//   tinytemplate-1.2.1
+//   unicode-width-0.1.8 "default"
+//   unicode-xid-0.2.1 "default"
+//   walkdir-2.3.2
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d583c31..a747ed8 100755
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,16 +6,7 @@
 
 ## [Unreleased]
 
-## [0.3.5] - 2021-07-26
-### Fixed
-- Corrected `Criterion.toml` in the book.
-- Corrected configuration typo in the book.
-
-### Changed
-- Bump plotters dependency to always include a bug-fix.
-- MSRV bumped to 1.46.
-
-## [0.3.4] - 2021-01-24
+## [0.3.4]
 ### Added
 - Added support for benchmarking async functions
 - Added `with_output_color` for enabling or disabling CLI output coloring programmatically.
diff --git a/Cargo.toml b/Cargo.toml
index 26e1e10..2c8ce7a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,7 @@
 [package]
 edition = "2018"
 name = "criterion"
-version = "0.3.5"
+version = "0.3.4"
 authors = ["Jorge Aparicio <japaricious@gmail.com>", "Brook Heisler <brookheisler@gmail.com>"]
 exclude = ["book/*"]
 description = "Statistics-driven micro-benchmarking library"
@@ -47,7 +47,7 @@
 default-features = false
 
 [dependencies.criterion-plot]
-version = "0.4.4"
+version = "0.4.3"
 
 [dependencies.csv]
 version = "1.1"
@@ -71,7 +71,7 @@
 version = "11.1"
 
 [dependencies.plotters]
-version = "^0.3.1"
+version = "^0.3.0"
 features = ["svg_backend", "area_series", "line_series"]
 default-features = false
 
@@ -112,7 +112,7 @@
 [dependencies.walkdir]
 version = "2.3"
 [dev-dependencies.approx]
-version = "0.5.0"
+version = "0.4"
 
 [dev-dependencies.futures]
 version = "0.3"
@@ -120,14 +120,14 @@
 default_features = false
 
 [dev-dependencies.quickcheck]
-version = "1.0"
+version = "0.9"
 default-features = false
 
 [dev-dependencies.rand]
 version = "0.8"
 
 [dev-dependencies.tempfile]
-version = "3.2.0"
+version = "3.1"
 
 [features]
 async = ["futures"]
@@ -140,6 +140,12 @@
 default = ["cargo_bench_support"]
 html_reports = []
 real_blackbox = []
-stable = ["async_futures", "async_smol", "async_tokio", "async_std"]
+[badges.appveyor]
+id = "4255ads9ctpupcl2"
+repository = "bheisler/criterion.rs"
+
 [badges.maintenance]
 status = "passively-maintained"
+
+[badges.travis-ci]
+repository = "bheisler/criterion.rs"
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index c0e33f4..86a8f92 100755
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,61 +1,59 @@
 [package]
-authors = [
-  "Jorge Aparicio <japaricious@gmail.com>",
-  "Brook Heisler <brookheisler@gmail.com>",
-]
-name    = "criterion"
-version = "0.3.5"
+authors = ["Jorge Aparicio <japaricious@gmail.com>", "Brook Heisler <brookheisler@gmail.com>"]
+name = "criterion"
+version = "0.3.4"
 edition = "2018"
 
 description = "Statistics-driven micro-benchmarking library"
-homepage    = "https://bheisler.github.io/criterion.rs/book/index.html"
-repository  = "https://github.com/bheisler/criterion.rs"
-readme      = "README.md"
-keywords    = ["criterion", "benchmark"]
-categories  = ["development-tools::profiling"]
-license     = "Apache-2.0/MIT"
-exclude     = ["book/*"]
+homepage = "https://bheisler.github.io/criterion.rs/book/index.html"
+repository = "https://github.com/bheisler/criterion.rs"
+readme = "README.md"
+keywords = ["criterion", "benchmark"]
+categories = ["development-tools::profiling"]
+license = "Apache-2.0/MIT"
+exclude = ["book/*"]
 
 [dependencies]
-lazy_static    = "1.4"
-criterion-plot = { path = "plot", version = "0.4.4" }
-itertools      = "0.10"
-serde          = "1.0"
-serde_json     = "1.0"
-serde_derive   = "1.0"
-serde_cbor     = "0.11"
-atty           = "0.2"
-clap           = { version = "2.33", default-features = false }
-csv            = "1.1"
-walkdir        = "2.3"
-tinytemplate   = "1.1"
-cast           = "0.2"
-num-traits     = { version = "0.2", default-features = false }
-oorandom       = "11.1"
-rayon          = "1.3"
-regex          = { version = "1.3", default-features = false, features = ["std"] }
-futures        = { version = "0.3", default_features = false, optional = true }
-smol           = { version = "1.2", default-features = false, optional = true }
-tokio          = { version = "1.0", default-features = false, features = ["rt"], optional = true }
-async-std      = { version = "1.9", optional = true }
+lazy_static = "1.4"
+criterion-plot = { path="plot", version="0.4.3" }
+itertools = "0.10"
+serde = "1.0"
+serde_json = "1.0"
+serde_derive = "1.0"
+serde_cbor = "0.11"
+atty = "0.2"
+clap = { version = "2.33", default-features = false }
+csv = "1.1"
+walkdir = "2.3"
+tinytemplate = "1.1"
+cast = "0.2"
+num-traits = { version = "0.2", default-features = false }
+oorandom = "11.1"
+rayon = "1.3"
+regex = { version = "1.3", default-features = false, features = ["std"] }
+futures = { version = "0.3", default_features = false, optional = true }
+smol = { version = "1.2", default-features = false, optional = true }
+tokio = { version = "1.0", default-features = false, features = ["rt"], optional = true }
+async-std = { version = "1.9", optional = true }
 
 [dependencies.plotters]
-version          = "^0.3.1"
+version = "^0.3.0"
 default-features = false
-features         = ["svg_backend", "area_series", "line_series"]
+features = ["svg_backend", "area_series", "line_series"] 
 
 [dev-dependencies]
-tempfile   = "3.2.0"
-approx     = "0.5.0"
-quickcheck = { version = "1.0", default-features = false }
-rand       = "0.8"
-futures    = { version = "0.3", default_features = false, features = ["executor"] }
+tempfile = "3.1"
+approx = "0.4"
+quickcheck = { version = "0.9", default-features = false }
+rand = "0.8"
+futures = { version = "0.3", default_features = false, features = ["executor"] }
 
 [badges]
+travis-ci = { repository = "bheisler/criterion.rs" }
+appveyor = { repository = "bheisler/criterion.rs", id = "4255ads9ctpupcl2" }
 maintenance = { status = "passively-maintained" }
 
 [features]
-stable  = ["async_futures", "async_smol", "async_tokio", "async_std"]
 default = ["cargo_bench_support"]
 
 # Enable use of the nightly-only test::black_box function to discourage compiler optimizations.
@@ -67,9 +65,9 @@
 # These features enable built-in support for running async benchmarks on each different async 
 # runtime.
 async_futures = ["futures/executor", "async"]
-async_smol    = ["smol", "async"]
-async_tokio   = ["tokio", "async"]
-async_std     = ["async-std", "async"]
+async_smol = ["smol", "async"]
+async_tokio = ["tokio", "async"]
+async_std = ["async-std", "async"]
 
 # This feature _currently_ does nothing except disable a warning message, but in 0.4.0 it will be
 # required in order to have Criterion.rs generate its own plots (as opposed to using cargo-criterion)
@@ -88,7 +86,7 @@
 exclude = ["cargo-criterion"]
 
 [[bench]]
-name    = "bench_main"
+name = "bench_main"
 harness = false
 
 [lib]
@@ -96,4 +94,4 @@
 
 # Enable all of the async runtimes for the docs.rs output
 [package.metadata.docs.rs]
-features = ["async_futures", "async_smol", "async_std", "async_tokio"]
+features = ["async_futures", "async_smol", "async_std", "async_tokio"]
\ No newline at end of file
diff --git a/METADATA b/METADATA
index 7700018..2ca3480 100644
--- a/METADATA
+++ b/METADATA
@@ -7,13 +7,13 @@
   }
   url {
     type: ARCHIVE
-    value: "https://static.crates.io/crates/criterion/criterion-0.3.5.crate"
+    value: "https://static.crates.io/crates/criterion/criterion-0.3.4.crate"
   }
-  version: "0.3.5"
+  version: "0.3.4"
   license_type: NOTICE
   last_upgrade_date {
     year: 2021
-    month: 8
-    day: 9
+    month: 4
+    day: 2
   }
 }
diff --git a/README.md b/README.md
index 0d12aa9..bb5bbab 100755
--- a/README.md
+++ b/README.md
@@ -15,8 +15,8 @@
 </div>
 
 <div align="center">
-	<a href="https://github.com/bheisler/criterion.rs/actions/workflows/ci.yaml">
-        <img src="https://img.shields.io/github/checks-status/rgeometry/rgeometry/main?label=tests&logo=github" alt="GitHub branch checks state">
+	<a href="https://travis-ci.org/bheisler/criterion.rs">
+        <img src="https://travis-ci.org/bheisler/criterion.rs.svg?branch=master" alt="Travis-CI">
     </a>
     |
     <a href="https://ci.appveyor.com/project/bheisler/criterion-rs-vt9fl">
@@ -117,9 +117,9 @@
 ### Compatibility Policy
 
 Criterion.<span></span>rs supports the last three stable minor releases of Rust. At time of
-writing, this means Rust 1.50 or later. Older versions may work, but are not guaranteed.
+writing, this means Rust 1.40 or later. Older versions may work, but are not tested or guaranteed.
 
-Currently, the oldest version of Rust believed to work is 1.46. Future versions of Criterion.<span></span>rs may
+Currently, the oldest version of Rust believed to work is 1.39. Future versions of Criterion.<span></span>rs may
 break support for such old versions, and this will not be considered a breaking change. If you
 require Criterion.<span></span>rs to work on old versions of Rust, you will need to stick to a
 specific patch version of Criterion.<span></span>rs.
diff --git a/TEST_MAPPING b/TEST_MAPPING
deleted file mode 100644
index 3cbd48d..0000000
--- a/TEST_MAPPING
+++ /dev/null
@@ -1,17 +0,0 @@
-// Generated by update_crate_tests.py for tests that depend on this crate.
-{
-  "imports": [
-    {
-      "path": "external/rust/crates/base64"
-    },
-    {
-      "path": "external/rust/crates/tinytemplate"
-    },
-    {
-      "path": "external/rust/crates/tinyvec"
-    },
-    {
-      "path": "external/rust/crates/unicode-xid"
-    }
-  ]
-}
diff --git a/appveyor.yml b/appveyor.yml
index f883c86..c145df3 100755
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -5,9 +5,6 @@
     - TARGET: x86_64-pc-windows-msvc
       GNUPLOT: no
 
-cache:
-  - 'C:\Users\appveyor\.cargo'
-
 install:
   - curl -sSf -o rustup-init.exe https://win.rustup.rs/
   - rustup-init.exe -y --default-host %TARGET% --default-toolchain stable
@@ -24,8 +21,7 @@
   - cargo build --release
   - cargo test --all --release
   - cargo build --benches --all --release
-# Disable benchmarking until performance can be improved.
-#  - cargo bench
+  - cargo bench
   - cargo doc --release --all --no-deps
 
 branches:
diff --git a/cargo2android.json b/cargo2android.json
deleted file mode 100644
index bf78496..0000000
--- a/cargo2android.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-  "device": true,
-  "run": true
-}
\ No newline at end of file
diff --git a/src/analysis/mod.rs b/src/analysis/mod.rs
index 5d84bef..1c072e1 100755
--- a/src/analysis/mod.rs
+++ b/src/analysis/mod.rs
@@ -53,10 +53,10 @@
             &criterion.baseline_directory,
             &criterion.output_directory,
         ) {
-            panic!(
+            panic!(format!(
                 "Baseline '{base}' must exist before comparison is allowed; try --save-baseline {base}",
                 base=criterion.baseline_directory,
-            );
+            ));
         }
     }
 
@@ -278,7 +278,7 @@
     )
     .0;
 
-    let point = Slope::fit(data);
+    let point = Slope::fit(&data);
     let (lb, ub) = distribution.confidence_interval(config.confidence_level);
     let se = distribution.std_dev(None);
 
diff --git a/src/benchmark_group.rs b/src/benchmark_group.rs
index 723d01e..ecb8258 100755
--- a/src/benchmark_group.rs
+++ b/src/benchmark_group.rs
@@ -345,7 +345,7 @@
                     func.profile(
                         &self.criterion.measurement,
                         &id,
-                        self.criterion,
+                        &self.criterion,
                         &report_context,
                         duration,
                         input,
diff --git a/src/csv_report.rs b/src/csv_report.rs
index 3b744df..f30b817 100755
--- a/src/csv_report.rs
+++ b/src/csv_report.rs
@@ -31,14 +31,14 @@
         let mut data_scaled: Vec<f64> = data.sample_times().as_ref().into();
         let unit = formatter.scale_for_machines(&mut data_scaled);
         let group = id.group_id.as_str();
-        let function = id.function_id.as_deref();
-        let value = id.value_str.as_deref();
+        let function = id.function_id.as_ref().map(String::as_str);
+        let value = id.value_str.as_ref().map(String::as_str);
         let (throughput_num, throughput_type) = match id.throughput {
             Some(Throughput::Bytes(bytes)) => (Some(format!("{}", bytes)), Some("bytes")),
             Some(Throughput::Elements(elems)) => (Some(format!("{}", elems)), Some("elements")),
             None => (None, None),
         };
-        let throughput_num = throughput_num.as_deref();
+        let throughput_num = throughput_num.as_ref().map(String::as_str);
 
         for (count, measured_value) in data.iter_counts().iter().zip(data_scaled.into_iter()) {
             let row = CsvRow {
diff --git a/src/error.rs b/src/error.rs
index 9b7eb17..c1ecf76 100755
--- a/src/error.rs
+++ b/src/error.rs
@@ -5,7 +5,6 @@
 use std::io;
 use std::path::PathBuf;
 
-#[allow(clippy::enum_variant_names)]
 #[derive(Debug)]
 pub enum Error {
     AccessError {
diff --git a/src/html/mod.rs b/src/html/mod.rs
index d360656..02ff0de 100755
--- a/src/html/mod.rs
+++ b/src/html/mod.rs
@@ -199,8 +199,8 @@
         let mut individual_links = HashMap::with_capacity(ids.len());
 
         for id in ids.iter() {
-            let function_id = id.function_id.as_deref();
-            let value = id.value_str.as_deref();
+            let function_id = id.function_id.as_ref().map(String::as_str);
+            let value = id.value_str.as_ref().map(String::as_str);
 
             let individual_link = ReportLink::individual(output_directory, id);
 
@@ -218,12 +218,12 @@
         // numerically. Otherwise sort lexicographically.
         if values.iter().all(|os| parse_opt(os).is_some()) {
             values.sort_unstable_by(|v1, v2| {
-                let num1 = parse_opt(v1);
-                let num2 = parse_opt(v2);
+                let num1 = parse_opt(&v1);
+                let num2 = parse_opt(&v2);
 
                 num1.partial_cmp(&num2).unwrap_or(Ordering::Less)
             });
-            values.dedup_by_key(|os| parse_opt(os).unwrap());
+            values.dedup_by_key(|os| parse_opt(&os).unwrap());
         } else {
             values.sort_unstable();
             values.dedup();
@@ -438,14 +438,14 @@
 
         // If all of the value strings can be parsed into a number, sort/dedupe
         // numerically. Otherwise sort lexicographically.
-        if value_strs.iter().all(|os| try_parse(*os).is_some()) {
+        if value_strs.iter().all(|os| try_parse(&*os).is_some()) {
             value_strs.sort_unstable_by(|v1, v2| {
-                let num1 = try_parse(v1);
-                let num2 = try_parse(v2);
+                let num1 = try_parse(&v1);
+                let num2 = try_parse(&v2);
 
                 num1.partial_cmp(&num2).unwrap_or(Ordering::Less)
             });
-            value_strs.dedup_by_key(|os| try_parse(os).unwrap());
+            value_strs.dedup_by_key(|os| try_parse(&os).unwrap());
         } else {
             value_strs.sort_unstable();
             value_strs.dedup();
@@ -455,7 +455,7 @@
             let samples_with_function: Vec<_> = data
                 .iter()
                 .by_ref()
-                .filter(|&&(id, _)| id.function_id.as_ref() == Some(function_id))
+                .filter(|&&(ref id, _)| id.function_id.as_ref() == Some(&function_id))
                 .collect();
 
             if samples_with_function.len() > 1 {
@@ -476,7 +476,7 @@
             let samples_with_value: Vec<_> = data
                 .iter()
                 .by_ref()
-                .filter(|&&(id, _)| id.value_str.as_ref() == Some(value_str))
+                .filter(|&&(ref id, _)| id.value_str.as_ref() == Some(&value_str))
                 .collect();
 
             if samples_with_value.len() > 1 {
@@ -497,13 +497,17 @@
         // First sort the ids/data by value.
         // If all of the value strings can be parsed into a number, sort/dedupe
         // numerically. Otherwise sort lexicographically.
-        let all_values_numeric = all_data
-            .iter()
-            .all(|(id, _)| id.value_str.as_deref().and_then(try_parse).is_some());
+        let all_values_numeric = all_data.iter().all(|(ref id, _)| {
+            id.value_str
+                .as_ref()
+                .map(String::as_str)
+                .and_then(try_parse)
+                .is_some()
+        });
         if all_values_numeric {
             all_data.sort_unstable_by(|(a, _), (b, _)| {
-                let num1 = a.value_str.as_deref().and_then(try_parse);
-                let num2 = b.value_str.as_deref().and_then(try_parse);
+                let num1 = a.value_str.as_ref().map(String::as_str).and_then(try_parse);
+                let num2 = b.value_str.as_ref().map(String::as_str).and_then(try_parse);
 
                 num1.partial_cmp(&num2).unwrap_or(Ordering::Less)
             });
@@ -573,7 +577,7 @@
             if !different_mean {
                 explanation_str = "No change in performance detected.".to_owned();
             } else {
-                let comparison = compare_to_threshold(mean_est, comp.noise_threshold);
+                let comparison = compare_to_threshold(&mean_est, comp.noise_threshold);
                 match comparison {
                     ComparisonResult::Improved => {
                         explanation_str = "Performance has improved.".to_owned();
@@ -685,7 +689,7 @@
                 fs::mkdirp(&both_dir)
             });
 
-            let comp_data = plot_data.comparison(comp);
+            let comp_data = plot_data.comparison(&comp);
 
             self.plotter.borrow_mut().pdf(plot_ctx, comp_data);
             self.plotter.borrow_mut().pdf(plot_ctx_small, comp_data);
@@ -763,12 +767,12 @@
 
         self.plotter.borrow_mut().violin(plot_ctx, formatter, data);
 
-        let value_types: Vec<_> = data.iter().map(|&&(id, _)| id.value_type()).collect();
+        let value_types: Vec<_> = data.iter().map(|&&(ref id, _)| id.value_type()).collect();
         let mut line_path = None;
 
         if value_types.iter().all(|x| x == &value_types[0]) {
             if let Some(value_type) = value_types[0] {
-                let values: Vec<_> = data.iter().map(|&&(id, _)| id.as_number()).collect();
+                let values: Vec<_> = data.iter().map(|&&(ref id, _)| id.as_number()).collect();
                 if values.iter().any(|x| x != &values[0]) {
                     self.plotter
                         .borrow_mut()
@@ -781,7 +785,7 @@
         let path_prefix = if full_summary { "../.." } else { "../../.." };
         let benchmarks = data
             .iter()
-            .map(|&&(id, _)| {
+            .map(|&&(ref id, _)| {
                 IndividualBenchmark::from_id(&report_context.output_directory, path_prefix, id)
             })
             .collect();
diff --git a/src/lib.rs b/src/lib.rs
index 98dcf1e..7cc4070 100755
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -23,7 +23,9 @@
     allow(
         clippy::just_underscores_and_digits, // Used in the stats code
         clippy::transmute_ptr_to_ptr, // Used in the stats code
+        clippy::option_as_ref_deref, // Remove when MSRV bumped above 1.40
         clippy::manual_non_exhaustive, // Remove when MSRV bumped above 1.40
+        clippy::match_like_matches_macro, // Remove when MSRV bumped above 1.42
     )
 )]
 
@@ -337,7 +339,10 @@
 }
 impl Mode {
     pub fn is_benchmark(&self) -> bool {
-        matches!(self, Mode::Benchmark)
+        match self {
+            Mode::Benchmark => true,
+            _ => false,
+        }
     }
 }
 
@@ -1510,7 +1515,10 @@
     }
 
     fn is_linear(&self) -> bool {
-        matches!(self, ActualSamplingMode::Linear)
+        match self {
+            ActualSamplingMode::Linear => true,
+            _ => false,
+        }
     }
 
     fn recommend_linear_sample_size(target_time: f64, met: f64) -> u64 {
diff --git a/src/macros.rs b/src/macros.rs
index 85d8c59..2ca7a7d 100755
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -73,7 +73,7 @@
         }
     };
     ($name:ident, $( $target:path ),+ $(,)*) => {
-        $crate::criterion_group!{
+        criterion_group!{
             name = $name;
             config = $crate::Criterion::default();
             targets = $( $target ),+
diff --git a/src/plot/gnuplot_backend/mod.rs b/src/plot/gnuplot_backend/mod.rs
index 95e07ef..e902d47 100755
--- a/src/plot/gnuplot_backend/mod.rs
+++ b/src/plot/gnuplot_backend/mod.rs
@@ -1,5 +1,5 @@
 use std::iter;
-use std::path::Path;
+use std::path::PathBuf;
 use std::process::Child;
 
 use crate::stats::univariate::Sample;
@@ -40,9 +40,9 @@
 const DARK_ORANGE: Color = Color::Rgb(255, 127, 0);
 const DARK_RED: Color = Color::Rgb(227, 26, 28);
 
-fn debug_script(path: &Path, figure: &Figure) {
+fn debug_script(path: &PathBuf, figure: &Figure) {
     if crate::debug_enabled() {
-        let mut script_path = path.to_path_buf();
+        let mut script_path = path.clone();
         script_path.set_extension("gnuplot");
         info!("Writing gnuplot script to {:?}", script_path);
         let result = figure.save(script_path.as_path());
diff --git a/src/plot/gnuplot_backend/pdf.rs b/src/plot/gnuplot_backend/pdf.rs
index a0b85c7..3ee2360 100755
--- a/src/plot/gnuplot_backend/pdf.rs
+++ b/src/plot/gnuplot_backend/pdf.rs
@@ -33,7 +33,7 @@
         format!("Iterations (x 10^{})", exponent)
     };
 
-    let (xs, ys) = kde::sweep(scaled_avg_times, KDE_POINTS, None);
+    let (xs, ys) = kde::sweep(&scaled_avg_times, KDE_POINTS, None);
     let (lost, lomt, himt, hist) = avg_times.fences();
     let mut fences = [lost, lomt, himt, hist];
     let _ = formatter.scale_values(typical, &mut fences);
diff --git a/src/plot/gnuplot_backend/summary.rs b/src/plot/gnuplot_backend/summary.rs
index d57a174..e944360 100755
--- a/src/plot/gnuplot_backend/summary.rs
+++ b/src/plot/gnuplot_backend/summary.rs
@@ -83,9 +83,9 @@
     // This assumes the curves are sorted. It also assumes that the benchmark IDs all have numeric
     // values or throughputs and that value is sensible (ie. not a mix of bytes and elements
     // or whatnot)
-    for (key, group) in &all_curves.iter().group_by(|&&&(id, _)| &id.function_id) {
+    for (key, group) in &all_curves.iter().group_by(|&&&(ref id, _)| &id.function_id) {
         let mut tuples: Vec<_> = group
-            .map(|&&(id, ref sample)| {
+            .map(|&&(ref id, ref sample)| {
                 // Unwrap is fine here because it will only fail if the assumptions above are not true
                 // ie. programmer error.
                 let x = id.as_number().unwrap();
@@ -185,7 +185,7 @@
                     positions: tics(),
                     labels: all_curves
                         .iter()
-                        .map(|&&(id, _)| gnuplot_escape(id.as_title())),
+                        .map(|&&(ref id, _)| gnuplot_escape(id.as_title())),
                 })
         });
 
diff --git a/src/plot/plotters_backend/pdf.rs b/src/plot/plotters_backend/pdf.rs
index 333893f..1297b79 100755
--- a/src/plot/plotters_backend/pdf.rs
+++ b/src/plot/plotters_backend/pdf.rs
@@ -197,7 +197,7 @@
         format!("Iterations (x 10^{})", exponent)
     };
 
-    let (xs, ys) = kde::sweep(scaled_avg_times, KDE_POINTS, None);
+    let (xs, ys) = kde::sweep(&scaled_avg_times, KDE_POINTS, None);
     let (lost, lomt, himt, hist) = avg_times.fences();
     let mut fences = [lost, lomt, himt, hist];
     let _ = formatter.scale_values(typical, &mut fences);
diff --git a/src/plot/plotters_backend/summary.rs b/src/plot/plotters_backend/summary.rs
index dad8a5b..14f4b5e 100755
--- a/src/plot/plotters_backend/summary.rs
+++ b/src/plot/plotters_backend/summary.rs
@@ -46,8 +46,8 @@
         AxisScale::Logarithmic => draw_line_comarision_figure(
             root_area,
             unit,
-            x_range.log_scale(),
-            y_range.log_scale(),
+            LogRange(x_range),
+            LogRange(y_range),
             value_type,
             series_data,
         ),
@@ -132,9 +132,9 @@
     // This assumes the curves are sorted. It also assumes that the benchmark IDs all have numeric
     // values or throughputs and that value is sensible (ie. not a mix of bytes and elements
     // or whatnot)
-    for (key, group) in &all_curves.iter().group_by(|&&&(id, _)| &id.function_id) {
+    for (key, group) in &all_curves.iter().group_by(|&&&(ref id, _)| &id.function_id) {
         let mut tuples: Vec<_> = group
-            .map(|&&(id, ref sample)| {
+            .map(|&&(ref id, ref sample)| {
                 // Unwrap is fine here because it will only fail if the assumptions above are not true
                 // ie. programmer error.
                 let x = id.as_number().unwrap();
@@ -164,7 +164,7 @@
 
     let mut kdes = all_curves
         .iter()
-        .map(|&&(id, ref sample)| {
+        .map(|&&(ref id, ref sample)| {
             let (x, mut y) = kde::sweep(Sample::new(sample), KDE_POINTS, None);
             let y_max = Sample::new(&y).max();
             for y in y.iter_mut() {
@@ -211,7 +211,7 @@
     match axis_scale {
         AxisScale::Linear => draw_violin_figure(root_area, unit, x_range, y_range, kdes),
         AxisScale::Logarithmic => {
-            draw_violin_figure(root_area, unit, x_range.log_scale(), y_range, kdes)
+            draw_violin_figure(root_area, unit, LogRange(x_range), y_range, kdes)
         }
     }
 }
diff --git a/src/report.rs b/src/report.rs
index 60a144a..9148a9e 100755
--- a/src/report.rs
+++ b/src/report.rs
@@ -609,7 +609,7 @@
             if !different_mean {
                 explanation_str = "No change in performance detected.".to_owned();
             } else {
-                let comparison = compare_to_threshold(mean_est, comp.noise_threshold);
+                let comparison = compare_to_threshold(&mean_est, comp.noise_threshold);
                 match comparison {
                     ComparisonResult::Improved => {
                         point_estimate_str = self.green(self.bold(point_estimate_str));
diff --git a/src/stats/bivariate/bootstrap.rs b/src/stats/bivariate/bootstrap.rs
index 9eb7fa7..8fe8ede 100755
--- a/src/stats/bivariate/bootstrap.rs
+++ b/src/stats/bivariate/bootstrap.rs
@@ -10,12 +10,8 @@
             use crate::stats::bivariate::Data;
 
             quickcheck! {
-                fn means(size: u8, start: u8,
-                         offset: u8, nresamples: u8) -> TestResult {
-                    let size = size as usize;
-                    let start = start as usize;
-                    let offset = offset as usize;
-                    let nresamples = nresamples as usize;
+                fn means(size: usize, start: usize,
+                         offset: usize, nresamples: usize) -> TestResult {
                     if let Some(x) = crate::stats::test::vec::<$ty>(size, start) {
                         let y = crate::stats::test::vec::<$ty>(size + offset, start + offset).unwrap();
                         let data = Data::new(&x[start..], &y[start+offset..]);
@@ -52,12 +48,8 @@
             }
 
             quickcheck! {
-                fn slope(size: u8, start: u8,
-                         offset: u8, nresamples: u8) -> TestResult {
-                    let size = size as usize;
-                    let start = start as usize;
-                    let offset = offset as usize;
-                    let nresamples = nresamples as usize;
+                fn slope(size: usize, start: usize,
+                         offset: usize, nresamples: usize) -> TestResult {
                     if let Some(x) = crate::stats::test::vec::<$ty>(size, start) {
                         let y = crate::stats::test::vec::<$ty>(size + offset, start + offset).unwrap();
                         let data = Data::new(&x[start..], &y[start+offset..]);
diff --git a/src/stats/bivariate/mod.rs b/src/stats/bivariate/mod.rs
index d1e8df7..b233b60 100755
--- a/src/stats/bivariate/mod.rs
+++ b/src/stats/bivariate/mod.rs
@@ -97,12 +97,12 @@
 
     /// Returns a view into the `X` data
     pub fn x(&self) -> &'a Sample<X> {
-        Sample::new(self.0)
+        Sample::new(&self.0)
     }
 
     /// Returns a view into the `Y` data
     pub fn y(&self) -> &'a Sample<Y> {
-        Sample::new(self.1)
+        Sample::new(&self.1)
     }
 }
 
diff --git a/src/stats/univariate/bootstrap.rs b/src/stats/univariate/bootstrap.rs
index 21c9140..dbb52f5 100755
--- a/src/stats/univariate/bootstrap.rs
+++ b/src/stats/univariate/bootstrap.rs
@@ -9,10 +9,7 @@
             use crate::stats::univariate::{Sample, mixed, self};
 
             quickcheck!{
-                fn mean(size: u8, start: u8, nresamples: u8) -> TestResult {
-                    let size = size as usize;
-                    let start = start as usize;
-                    let nresamples = nresamples as usize;
+                fn mean(size: usize, start: usize, nresamples: usize) -> TestResult {
                     if let Some(v) = crate::stats::test::vec::<$ty>(size, start) {
                         let sample = Sample::new(&v[start..]);
 
@@ -41,10 +38,7 @@
             }
 
             quickcheck!{
-                fn mean_median(size: u8, start: u8, nresamples: u8) -> TestResult {
-                    let size = size as usize;
-                    let start = start as usize;
-                    let nresamples = nresamples as usize;
+                fn mean_median(size: usize, start: usize, nresamples: usize) -> TestResult {
                     if let Some(v) = crate::stats::test::vec::<$ty>(size, start) {
                         let sample = Sample::new(&v[start..]);
 
@@ -79,15 +73,10 @@
 
             quickcheck!{
                 fn mixed_two_sample(
-                    a_size: u8, a_start: u8,
-                    b_size: u8, b_start: u8,
-                    nresamples: u8
+                    a_size: usize, a_start: usize,
+                    b_size: usize, b_start: usize,
+                    nresamples: usize
                 ) -> TestResult {
-                    let a_size = a_size as usize;
-                    let b_size = b_size as usize;
-                    let a_start = a_start as usize;
-                    let b_start = b_start as usize;
-                    let nresamples = nresamples as usize;
                     if let (Some(a), Some(b)) =
                         (crate::stats::test::vec::<$ty>(a_size, a_start), crate::stats::test::vec::<$ty>(b_size, b_start))
                     {
@@ -120,15 +109,10 @@
 
             quickcheck!{
                 fn two_sample(
-                    a_size: u8, a_start: u8,
-                    b_size: u8, b_start: u8,
-                    nresamples: u8
+                    a_size: usize, a_start: usize,
+                    b_size: usize, b_start: usize,
+                    nresamples: usize
                 ) -> TestResult {
-                    let a_size = a_size as usize;
-                    let b_size = b_size as usize;
-                    let a_start = a_start as usize;
-                    let b_start = b_start as usize;
-                    let nresamples = nresamples as usize;
                     if let (Some(a), Some(b)) =
                         (crate::stats::test::vec::<$ty>(a_size, a_start), crate::stats::test::vec::<$ty>(b_size, b_start))
                     {
diff --git a/src/stats/univariate/kde/kernel.rs b/src/stats/univariate/kde/kernel.rs
index c3d0ff5..b4204f5 100755
--- a/src/stats/univariate/kde/kernel.rs
+++ b/src/stats/univariate/kde/kernel.rs
@@ -39,15 +39,13 @@
 
                 quickcheck! {
                     fn symmetric(x: $ty) -> bool {
-                        x.is_nan() || relative_eq!(Gaussian.evaluate(-x), Gaussian.evaluate(x))
+                        relative_eq!(Gaussian.evaluate(-x), Gaussian.evaluate(x))
                     }
                 }
 
                 // Any [a b] integral should be in the range [0 1]
                 quickcheck! {
                     fn integral(a: $ty, b: $ty) -> TestResult {
-                        let a = a.sin().abs(); // map the value to [0 1]
-                        let b = b.sin().abs(); // map the value to [0 1]
                         const DX: $ty = 1e-3;
 
                         if a > b {
diff --git a/src/stats/univariate/kde/mod.rs b/src/stats/univariate/kde/mod.rs
index 9b0836d..efc27cd 100755
--- a/src/stats/univariate/kde/mod.rs
+++ b/src/stats/univariate/kde/mod.rs
@@ -98,9 +98,7 @@
 
             // The [-inf inf] integral of the estimated PDF should be one
             quickcheck! {
-                fn integral(size: u8, start: u8) -> TestResult {
-                    let size = size as usize;
-                    let start = start as usize;
+                fn integral(size: usize, start: usize) -> TestResult {
                     const DX: $ty = 1e-3;
 
                     if let Some(v) = crate::stats::test::vec::<$ty>(size, start) {
diff --git a/src/stats/univariate/outliers/tukey.rs b/src/stats/univariate/outliers/tukey.rs
index 70713ac..bfd08f1 100755
--- a/src/stats/univariate/outliers/tukey.rs
+++ b/src/stats/univariate/outliers/tukey.rs
@@ -224,27 +224,42 @@
 impl Label {
     /// Checks if the data point has an "unusually" high value
     pub fn is_high(&self) -> bool {
-        matches!(*self, HighMild | HighSevere)
+        match *self {
+            HighMild | HighSevere => true,
+            _ => false,
+        }
     }
 
     /// Checks if the data point is labeled as a "mild" outlier
     pub fn is_mild(&self) -> bool {
-        matches!(*self, HighMild | LowMild)
+        match *self {
+            HighMild | LowMild => true,
+            _ => false,
+        }
     }
 
     /// Checks if the data point has an "unusually" low value
     pub fn is_low(&self) -> bool {
-        matches!(*self, LowMild | LowSevere)
+        match *self {
+            LowMild | LowSevere => true,
+            _ => false,
+        }
     }
 
     /// Checks if the data point is labeled as an outlier
     pub fn is_outlier(&self) -> bool {
-        matches!(*self, NotAnOutlier)
+        match *self {
+            NotAnOutlier => false,
+            _ => true,
+        }
     }
 
     /// Checks if the data point is labeled as a "severe" outlier
     pub fn is_severe(&self) -> bool {
-        matches!(*self, HighSevere | LowSevere)
+        match *self {
+            HighSevere | LowSevere => true,
+            _ => false,
+        }
     }
 }
 
diff --git a/src/stats/univariate/resamples.rs b/src/stats/univariate/resamples.rs
index 923669d..831bc7a 100755
--- a/src/stats/univariate/resamples.rs
+++ b/src/stats/univariate/resamples.rs
@@ -70,9 +70,7 @@
 
     // Check that the resample is a subset of the sample
     quickcheck! {
-        fn subset(size: u8, nresamples: u8) -> TestResult {
-            let size = size as usize;
-            let nresamples = nresamples as usize;
+        fn subset(size: usize, nresamples: usize) -> TestResult {
             if size > 1 {
                 let v: Vec<_> = (0..size).map(|i| i as f32).collect();
                 let sample = Sample::new(&v);