Snap for 10453563 from 08ec94a928ff5b291faed3a29f274441032d6761 to mainline-permission-release

Change-Id: I48bd403918eb79de2f7c31a511f2045623130bbc
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 1abeeed..1098afe 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,6 @@
 {
   "git": {
-    "sha1": "97a70ee543c8984ce21c56824099fcfb96554c80"
-  }
-}
+    "sha1": "5e27b692a43a05736d073fd449e16dcf1c24628c"
+  },
+  "path_in_vcs": "plot"
+}
\ No newline at end of file
diff --git a/Android.bp b/Android.bp
index de3651a..61a84db 100644
--- a/Android.bp
+++ b/Android.bp
@@ -31,11 +31,17 @@
     host_supported: true,
     crate_name: "criterion_plot",
     cargo_env_compat: true,
-    cargo_pkg_version: "0.4.4",
+    cargo_pkg_version: "0.5.0",
     srcs: ["src/lib.rs"],
     edition: "2018",
     rustlibs: [
         "libcast",
         "libitertools",
     ],
+    apex_available: [
+        "//apex_available:platform",
+        "//apex_available:anyapex",
+    ],
+    product_available: true,
+    vendor_available: true,
 }
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index be5026b..59ae026 100755
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -55,6 +55,15 @@
 * Clearly document public methods
 * Write a good commit message
 
+## Branches
+
+*   PRs with breaking changes are made against the unreleased branch. e.g. branch version-0.4
+*   PRs without breaking changes are made against the master branch.
+
+If you're not sure which branch to use just start with master, as this can be changed during review.
+
+When it is time to release the unreleased branch, a PR is made from the unreleased branch to master. e.g. https://github.com/bheisler/criterion.rs/pull/496
+
 ## Github Labels
 
 Criterion.<span></span>rs uses a simple set of labels to track issues. Most important are the 
diff --git a/Cargo.toml b/Cargo.toml
index 5ddfdc6..9d64276 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,39 +3,48 @@
 # When uploading crates to the registry Cargo will automatically
 # "normalize" Cargo.toml files for maximal compatibility
 # with all versions of Cargo and also rewrite `path` dependencies
-# to registry (e.g., crates.io) dependencies
+# to registry (e.g., crates.io) dependencies.
 #
-# If you believe there's an error in this file please file an
-# issue against the rust-lang/cargo repository. If you're
-# editing this file be aware that the upstream Cargo.toml
-# will likely look very different (and much more reasonable)
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
 
 [package]
 edition = "2018"
 name = "criterion-plot"
-version = "0.4.4"
-authors = ["Jorge Aparicio <japaricious@gmail.com>", "Brook Heisler <brookheisler@gmail.com>"]
+version = "0.5.0"
+authors = [
+    "Jorge Aparicio <japaricious@gmail.com>",
+    "Brook Heisler <brookheisler@gmail.com>",
+]
 description = "Criterion's plotting library"
 readme = "README.md"
-keywords = ["plotting", "gnuplot", "criterion"]
+keywords = [
+    "plotting",
+    "gnuplot",
+    "criterion",
+]
 categories = ["visualization"]
 license = "MIT/Apache-2.0"
 repository = "https://github.com/bheisler/criterion.rs"
+
 [dependencies.cast]
-version = "0.2"
+version = "0.3"
 
 [dependencies.itertools]
 version = "0.10"
+
 [dev-dependencies.itertools-num]
 version = "0.1"
 
 [dev-dependencies.num-complex]
-version = "0.2"
+version = "0.4"
 features = ["std"]
 default-features = false
 
 [dev-dependencies.rand]
-version = "0.4"
+version = "0.8"
+
 [badges.appveyor]
 id = "4255ads9ctpupcl2"
 repository = "bheisler/criterion.rs"
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 76e0064..a1ce36e 100755
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,7 +1,7 @@
 [package]
 authors = ["Jorge Aparicio <japaricious@gmail.com>", "Brook Heisler <brookheisler@gmail.com>"]
 name = "criterion-plot"
-version = "0.4.4"
+version = "0.5.0"
 edition = "2018"
 
 description = "Criterion's plotting library"
@@ -12,13 +12,13 @@
 license = "MIT/Apache-2.0"
 
 [dependencies]
-cast = "0.2"
+cast = "0.3"
 itertools = "0.10"
 
 [dev-dependencies]
 itertools-num = "0.1"
-num-complex = { version = "0.2", default-features = false, features = ["std"] }
-rand = "0.4"
+num-complex = { version = "0.4", default-features = false, features = ["std"] }
+rand = "0.8"
 
 [badges]
 travis-ci = { repository = "bheisler/criterion.rs" }
diff --git a/METADATA b/METADATA
index e2fcb10..9c18332 100644
--- a/METADATA
+++ b/METADATA
@@ -1,3 +1,7 @@
+# This project was upgraded with external_updater.
+# Usage: tools/external_updater/updater.sh update rust/crates/criterion-plot
+# For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md
+
 name: "criterion-plot"
 description: "Criterion\'s plotting library"
 third_party {
@@ -7,13 +11,13 @@
   }
   url {
     type: ARCHIVE
-    value: "https://static.crates.io/crates/criterion-plot/criterion-plot-0.4.4.crate"
+    value: "https://static.crates.io/crates/criterion-plot/criterion-plot-0.5.0.crate"
   }
-  version: "0.4.4"
+  version: "0.5.0"
   license_type: NOTICE
   last_upgrade_date {
-    year: 2021
-    month: 8
-    day: 9
+    year: 2022
+    month: 12
+    day: 8
   }
 }
diff --git a/src/axis.rs b/src/axis.rs
index 97fd0cb..142c7fb 100755
--- a/src/axis.rs
+++ b/src/axis.rs
@@ -155,6 +155,9 @@
 }
 
 impl<'a> Script for (Axis, &'a Properties) {
+    // Allow clippy::format_push_string even with older versions of rust (<1.62) which
+    // don't have it defined.
+    #[allow(clippy::all)]
     fn script(&self) -> String {
         let &(axis, properties) = self;
         let axis_ = axis.display();
diff --git a/src/candlestick.rs b/src/candlestick.rs
index e0a5cbe..d1754e8 100755
--- a/src/candlestick.rs
+++ b/src/candlestick.rs
@@ -27,6 +27,9 @@
 }
 
 impl Script for Properties {
+    // Allow clippy::format_push_string even with older versions of rust (<1.62) which
+    // don't have it defined.
+    #[allow(clippy::all)]
     fn script(&self) -> String {
         let mut script = String::from("with candlesticks ");
 
diff --git a/src/curve.rs b/src/curve.rs
index bbddeff..a5766ee 100755
--- a/src/curve.rs
+++ b/src/curve.rs
@@ -38,6 +38,9 @@
 }
 
 impl Script for Properties {
+    // Allow clippy::format_push_string even with older versions of rust (<1.62) which
+    // don't have it defined.
+    #[allow(clippy::all)]
     fn script(&self) -> String {
         let mut script = if let Some(axes) = self.axes {
             format!("axes {} ", axes.display())
diff --git a/src/data.rs b/src/data.rs
index eb1f738..20ed3d4 100755
--- a/src/data.rs
+++ b/src/data.rs
@@ -1,5 +1,3 @@
-#![allow(deprecated)]
-
 use std::mem;
 
 use cast::From as _0;
diff --git a/src/errorbar.rs b/src/errorbar.rs
index 7efd23e..f7a823c 100755
--- a/src/errorbar.rs
+++ b/src/errorbar.rs
@@ -36,6 +36,9 @@
 }
 
 impl Script for Properties {
+    // Allow clippy::format_push_string even with older versions of rust (<1.62) which
+    // don't have it defined.
+    #[allow(clippy::all)]
     fn script(&self) -> String {
         let mut script = format!("with {} ", self.style.display());
 
diff --git a/src/filledcurve.rs b/src/filledcurve.rs
index f79dbdd..ab86099 100755
--- a/src/filledcurve.rs
+++ b/src/filledcurve.rs
@@ -27,6 +27,9 @@
 }
 
 impl Script for Properties {
+    // Allow clippy::format_push_string even with older versions of rust (<1.62) which
+    // don't have it defined.
+    #[allow(clippy::all)]
     fn script(&self) -> String {
         let mut script = if let Some(axes) = self.axes {
             format!("axes {} ", axes.display())
diff --git a/src/key.rs b/src/key.rs
index e8847d6..dc27755 100755
--- a/src/key.rs
+++ b/src/key.rs
@@ -48,6 +48,9 @@
 }
 
 impl Script for Properties {
+    // Allow clippy::format_push_string even with older versions of rust (<1.62) which
+    // don't have it defined.
+    #[allow(clippy::all)]
     fn script(&self) -> String {
         let mut script = if self.hidden {
             return String::from("set key off\n");
diff --git a/src/lib.rs b/src/lib.rs
index 151f019..be51105 100755
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -79,7 +79,7 @@
 //! use std::f64::consts::PI;
 //!
 //! use itertools_num::linspace;
-//! use rand::{Rng, XorShiftRng};
+//! use rand::Rng;
 //! use criterion_plot::prelude::*;
 //!
 //! fn sinc(mut x: f64) -> f64 {
@@ -97,7 +97,7 @@
 //! let ref xs_ = linspace::<f64>(-4., 4., 101).collect::<Vec<_>>();
 //!
 //! // Fake some data
-//! let ref mut rng: XorShiftRng = rand::thread_rng().gen();
+//! let ref mut rng = rand::thread_rng();
 //! let xs = linspace::<f64>(-4., 4., 13).skip(1).take(11);
 //! let ys = xs.map(|x| sinc(x) + 0.05 * rng.gen::<f64>() - 0.025).collect::<Vec<_>>();
 //! let y_low = ys.iter().map(|&y| y - 0.025 - 0.075 * rng.gen::<f64>()).collect::<Vec<_>>();
@@ -438,12 +438,15 @@
         }
     }
 
+    // Allow clippy::format_push_string even with older versions of rust (<1.62) which
+    // don't have it defined.
+    #[allow(clippy::all)]
     fn script(&self) -> Vec<u8> {
         let mut s = String::new();
 
         s.push_str(&format!(
             "set output '{}'\n",
-            self.output.display().to_string().replace("'", "''")
+            self.output.display().to_string().replace('\'', "''")
         ));
 
         if let Some(width) = self.box_width {