From 4073f3e35c2a9c5fdddce80929bfa397f1f47b07 Mon Sep 17 00:00:00 2001 From: Jeremy Andrews Date: Sat, 4 Dec 2021 13:04:37 +0100 Subject: [PATCH] fix clippy errors --- Cargo.toml | 4 ++-- examples/alternative_client/main.rs | 4 +--- examples/alternative_client/util.rs | 6 ++++-- examples/closure.rs | 2 +- examples/drupal_memcache.rs | 4 ++-- examples/session.rs | 2 +- examples/simple.rs | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f792ffd57..bda32c6f4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -64,7 +64,7 @@ rustc_version = "0.4" [dev-dependencies] httpmock = "0.6" -serial_test = "0.5" +isahc = "1.6" native-tls = "0.2" rustls = "0.19" -isahc = "1.6" +serial_test = "0.5" diff --git a/examples/alternative_client/main.rs b/examples/alternative_client/main.rs index 88cd90fe4..ddc0472ea 100644 --- a/examples/alternative_client/main.rs +++ b/examples/alternative_client/main.rs @@ -12,7 +12,7 @@ //! you may not use this file except in compliance with the License. //! You may obtain a copy of the License at //! -//! http://www.apache.org/licenses/LICENSE-2.0 +//! //! //! Unless required by applicable law or agreed to in writing, software //! distributed under the License is distributed on an "AS IS" BASIS, @@ -22,12 +22,10 @@ mod util; -use goose::metrics::{GooseRawRequest, GooseRequestMetric}; use goose::prelude::*; use isahc::prelude::*; use rand::Rng; -use regex::Regex; #[tokio::main] async fn main() -> Result<(), GooseError> { diff --git a/examples/alternative_client/util.rs b/examples/alternative_client/util.rs index d70ac5585..f67d52820 100644 --- a/examples/alternative_client/util.rs +++ b/examples/alternative_client/util.rs @@ -33,8 +33,10 @@ pub(crate) fn build_request_metric( status: http::StatusCode, ) -> GooseRequestMetric { let mut h: Vec = Vec::new(); - for header in headers { - h.push(format!("{:?}", header)); + if let Some(hs) = headers { + for header in hs { + h.push(format!("{:?}", header)); + } } // Record information about the request. diff --git a/examples/closure.rs b/examples/closure.rs index 3519ba5e1..6c450060d 100644 --- a/examples/closure.rs +++ b/examples/closure.rs @@ -8,7 +8,7 @@ //! you may not use this file except in compliance with the License. //! You may obtain a copy of the License at //! -//! http://www.apache.org/licenses/LICENSE-2.0 +//! //! //! Unless required by applicable law or agreed to in writing, software //! distributed under the License is distributed on an "AS IS" BASIS, diff --git a/examples/drupal_memcache.rs b/examples/drupal_memcache.rs index bad120e5e..503e9725d 100644 --- a/examples/drupal_memcache.rs +++ b/examples/drupal_memcache.rs @@ -1,5 +1,5 @@ //! Conversion of Locust load test used for the Drupal memcache module, from -//! https://github.com/tag1consulting/drupal-loadtest/ +//! //! //! To run, you must set up the load test environment as described in the above //! repository, and then run the example. You'll need to set --host and may want @@ -14,7 +14,7 @@ //! you may not use this file except in compliance with the License. //! You may obtain a copy of the License at //! -//! http://www.apache.org/licenses/LICENSE-2.0 +//! //! //! Unless required by applicable law or agreed to in writing, software //! distributed under the License is distributed on an "AS IS" BASIS, diff --git a/examples/session.rs b/examples/session.rs index 31b602158..3ff28f0a7 100644 --- a/examples/session.rs +++ b/examples/session.rs @@ -9,7 +9,7 @@ //! you may not use this file except in compliance with the License. //! You may obtain a copy of the License at //! -//! http://www.apache.org/licenses/LICENSE-2.0 +//! //! //! Unless required by applicable law or agreed to in writing, software //! distributed under the License is distributed on an "AS IS" BASIS, diff --git a/examples/simple.rs b/examples/simple.rs index 168d1123c..beca2b870 100644 --- a/examples/simple.rs +++ b/examples/simple.rs @@ -1,5 +1,5 @@ //! Simple Goose load test example. Duplicates the simple example on the -//! Locust project page (https://locust.io/). +//! Locust project page (). //! //! ## License //! @@ -9,7 +9,7 @@ //! you may not use this file except in compliance with the License. //! You may obtain a copy of the License at //! -//! http://www.apache.org/licenses/LICENSE-2.0 +//! //! //! Unless required by applicable law or agreed to in writing, software //! distributed under the License is distributed on an "AS IS" BASIS,