Skip to content

Commit

Permalink
cargo update clippy fixes (#483)
Browse files Browse the repository at this point in the history
* `cargo update` clippy fixes

* 1.0.10
  • Loading branch information
Billy-Sheppard committed May 9, 2024
1 parent 2fdba7f commit f2f0885
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "headless_chrome"
version = "1.0.9"
version = "1.0.10"
authors = ["Alistair Roche <alistair@sunburnt.country>"]
edition = "2021"
rust-version = "1.70"
Expand All @@ -12,8 +12,8 @@ readme = "README.md"

[dependencies]
anyhow = "1"
base64 = "0.21"
derive_builder = "0.12"
base64 = "0.22.1"
derive_builder = "0.20.0"
directories = { version = "5.0", optional = true }
log = "0.4"
rand = "0.8"
Expand All @@ -24,17 +24,17 @@ tempfile = "3"
thiserror = "1"
ureq = { version = "2.5", optional = true, features = ["proxy-from-env"] }
walkdir = { version = "2", optional = true }
tungstenite = "0.21"
tungstenite = "0.21.0"
url = "2.3"
which = "5.0"
zip = { version = "0.6.3", optional = true }
which = "6.0.1"
zip = { version = "1.2.1", optional = true }

[target.'cfg(windows)'.dependencies]
winreg = "0.52"
winreg = "0.52.0"

[dev-dependencies]
chrono = { version = "0.4", default_features = false, features = ["clock"] }
env_logger = "0.10"
env_logger = "0.11.3"
filepath = "0.1.1"
jpeg-decoder = { version = "0.3", default_features = false }
png = { version = "0.17" }
Expand Down
9 changes: 2 additions & 7 deletions src/testing_utils/logging.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
use std::io::Write;



use env_logger::fmt;
use log::*;
use std::io::Write;

pub fn enable_logging() {
let mut builder = env_logger::Builder::from_default_env();
Expand All @@ -14,10 +11,8 @@ pub fn enable_logging() {
let date = chrono::Local::now();

let level_str = level_to_emoji(record.level());
let mut style = buf.style();
let hours_minutes = date.format("%H:%M").to_string();
let seconds_millis = date.format("%S%.3f").to_string();
let fmt_seconds = style.set_bold(true).value(seconds_millis);

let truncated_module_path = &record.module_path().unwrap()[5..];

Expand All @@ -26,7 +21,7 @@ pub fn enable_logging() {
"{:<2} [{}:{}] - {:<12} - {}",
level_str,
hours_minutes,
fmt_seconds,
seconds_millis,
truncated_module_path,
record.args()
)
Expand Down
7 changes: 4 additions & 3 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ impl Default for Wait {
}

pub fn extract_midpoint(remote_obj: RemoteObject) -> Result<Point> {
let point = remote_obj.preview.map(|v| {
let mut prop_map = HashMap::new();
let mut prop_map = HashMap::new();

let points = remote_obj.preview.map(|v| {
for prop in v.properties {
prop_map.insert(prop.name, prop.value.unwrap().parse::<f64>().unwrap());
}
Expand All @@ -41,7 +42,7 @@ pub fn extract_midpoint(remote_obj: RemoteObject) -> Result<Point> {
}
});

match point {
match points {
Some(v) => Ok(v),
None => Ok(Point { x: 0.0, y: 0.0 }),
}
Expand Down

0 comments on commit f2f0885

Please sign in to comment.