From f905ccd5b6eccff84f0752c8843c6c410ff906ec Mon Sep 17 00:00:00 2001 From: Dilawar Singh Date: Sat, 12 Oct 2024 18:27:55 +0530 Subject: [PATCH 1/4] use tracing for logging --- Cargo.lock | 179 +++++++++++++++++++++++++++++++++++------------ Cargo.toml | 17 +++-- src/lib.rs | 3 - src/log.rs | 10 --- src/main.rs | 9 +-- src/speedtest.rs | 6 +- 6 files changed, 149 insertions(+), 75 deletions(-) delete mode 100644 src/log.rs diff --git a/Cargo.lock b/Cargo.lock index 6a8f710..1cf0e77 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -185,9 +185,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.10" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6b81fb3c84f5563d509c59b5a48d935f689e993afa90fe39047f05adef9142" +checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" dependencies = [ "clap_builder", "clap_derive", @@ -195,9 +195,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.10" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca6706fd5224857d9ac5eb9355f6683563cc0541c7cd9d014043b57cbec78ac" +checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" dependencies = [ "anstream", "anstyle", @@ -207,9 +207,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.8" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck", "proc-macro2", @@ -219,9 +219,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "colorchoice" @@ -316,29 +316,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "env_filter" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6dc8c8ff84895b051f07a0e65f975cf225131742531338752abfb324e4449ff" -dependencies = [ - "log", - "regex", -] - -[[package]] -name = "env_logger" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06676b12debf7bba6903559720abca942d3a66b8acb88815fd2c7c6537e9ade1" -dependencies = [ - "anstream", - "anstyle", - "env_filter", - "humantime", - "log", -] - [[package]] name = "equivalent" version = "1.0.1" @@ -504,9 +481,9 @@ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "heck" -version = "0.5.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" @@ -582,12 +559,6 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - [[package]] name = "hyper" version = "0.14.30" @@ -795,6 +766,15 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + [[package]] name = "md5" version = "0.7.0" @@ -871,6 +851,16 @@ dependencies = [ "tempfile", ] +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -939,6 +929,12 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + [[package]] name = "parking_lot" version = "0.12.3" @@ -1144,8 +1140,17 @@ checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", - "regex-automata", - "regex-syntax", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", ] [[package]] @@ -1156,9 +1161,15 @@ checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.8.4", ] +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + [[package]] name = "regex-syntax" version = "0.8.4" @@ -1387,6 +1398,15 @@ dependencies = [ "serde", ] +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + [[package]] name = "similar" version = "2.6.0" @@ -1425,7 +1445,6 @@ dependencies = [ "chrono", "clap", "csv", - "env_logger", "iter-read", "log", "md5", @@ -1434,6 +1453,8 @@ dependencies = [ "reqwest", "roxmltree", "serde", + "tracing", + "tracing-subscriber", "url", ] @@ -1445,9 +1466,9 @@ checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "strsim" -version = "0.11.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "subtle" @@ -1525,6 +1546,16 @@ dependencies = [ "syn", ] +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1646,6 +1677,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", ] [[package]] @@ -1698,6 +1759,12 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "vcpkg" version = "0.2.15" @@ -1804,6 +1871,28 @@ dependencies = [ "rustls-pki-types", ] +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + [[package]] name = "windows-core" version = "0.52.0" diff --git a/Cargo.toml b/Cargo.toml index 4b80f55..1ec0ded 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,12 +7,19 @@ name = "speedtest-rs" repository = "https://github.com/nelsonjchen/speedtest-rs" version = "0.2.0" edition = "2021" +rust-version = "1.70.0" + +[lib] +name = "speedtest_rs" + +[[bin]] +name = "speedtest-rs" +required-features = ["clap"] [dependencies] -clap = { version = "4.5.10", features = ["derive"] } +clap = { version = "<=4.4", features = ["derive"], optional = true } chrono = "0.4.38" -env_logger = "0.11.4" -log = { version = "0.4.22", optional = true } +log = { version = "0.4.22", optional = true } url = "2.5.2" mockito = "1.4.0" md5 = "0.7.0" @@ -21,12 +28,14 @@ serde = { version = "1.0.204", features = ["derive"] } roxmltree = "0.20.0" rayon = "1.10.0" iter-read = "1.0.1" +tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } +tracing = "0.1.40" [dependencies.reqwest] version = "0.12" features = ["blocking"] [features] -# default = ["log"] rustls-tls = ["reqwest/rustls-tls"] log = ["dep:log"] +clap = ["dep:clap"] diff --git a/src/lib.rs b/src/lib.rs index ab7b7c8..331126f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,6 +6,3 @@ pub mod speedtest; pub mod speedtest_config; pub mod speedtest_csv; pub mod speedtest_servers_config; - -#[cfg(not(feature = "log"))] -mod log; diff --git a/src/log.rs b/src/log.rs deleted file mode 100644 index f052783..0000000 --- a/src/log.rs +++ /dev/null @@ -1,10 +0,0 @@ -macro_rules! info { - // info!(target: "my_target", key1 = 42, key2 = true; "a {} event", "log") - // info!(target: "my_target", "a {} event", "log") - (target: $target:expr, $($arg:tt)+) => {}; - - // info!("a {} event", "log") - ($($arg:tt)+) => {}; -} - -pub(crate) use info; diff --git a/src/main.rs b/src/main.rs index 8d0e48b..fff52b4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,5 @@ mod distance; mod error; -#[cfg(not(feature = "log"))] -mod log; mod speedtest; mod speedtest_config; mod speedtest_csv; @@ -10,11 +8,8 @@ mod speedtest_servers_config; use crate::speedtest_csv::SpeedTestCsvResult; use chrono::Utc; use clap::Parser; -#[cfg(feature = "log")] -use log::info; -#[cfg(not(feature = "log"))] -use log::info; use std::io::{self, Write}; +use tracing::info; use url::Url; #[derive(Parser)] @@ -63,8 +58,6 @@ struct Cli { } fn main() -> Result<(), error::SpeedTestError> { - env_logger::init(); - let matches = Cli::parse(); // This appears to be purely informational. diff --git a/src/speedtest.rs b/src/speedtest.rs index 672bcc6..7c4e22c 100644 --- a/src/speedtest.rs +++ b/src/speedtest.rs @@ -7,11 +7,7 @@ use std::{ time::{Duration, SystemTime, UNIX_EPOCH}, }; -#[cfg(feature = "log")] -use log::info; - -#[cfg(not(feature = "log"))] -use super::log::info; +use tracing::info; use reqwest::blocking::{Body, Client, Request, Response}; use reqwest::header::{HeaderValue, CONNECTION, CONTENT_TYPE, REFERER, USER_AGENT}; From 97d178c31547b7a85a9f5029be4fe1956593e350 Mon Sep 17 00:00:00 2001 From: Dilawar Singh Date: Sat, 12 Oct 2024 18:34:33 +0530 Subject: [PATCH 2/4] chore: upgrade deps --- Cargo.lock | 124 ++++++++++++++-------------------------------------- Cargo.toml | 15 +++---- src/main.rs | 6 +++ 3 files changed, 45 insertions(+), 100 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1cf0e77..a6e645c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -435,25 +435,6 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" -[[package]] -name = "h2" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 0.2.12", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "h2" version = "0.4.5" @@ -465,7 +446,7 @@ dependencies = [ "fnv", "futures-core", "futures-sink", - "http 1.1.0", + "http", "indexmap", "slab", "tokio", @@ -491,17 +472,6 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" -[[package]] -name = "http" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - [[package]] name = "http" version = "1.1.0" @@ -513,17 +483,6 @@ dependencies = [ "itoa", ] -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http 0.2.12", - "pin-project-lite", -] - [[package]] name = "http-body" version = "1.0.0" @@ -531,7 +490,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" dependencies = [ "bytes", - "http 1.1.0", + "http", ] [[package]] @@ -542,8 +501,8 @@ checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", "futures-util", - "http 1.1.0", - "http-body 1.0.0", + "http", + "http-body", "pin-project-lite", ] @@ -559,29 +518,6 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" -[[package]] -name = "hyper" -version = "0.14.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "tokio", - "tower-service", - "tracing", - "want", -] - [[package]] name = "hyper" version = "1.4.1" @@ -591,10 +527,11 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.5", - "http 1.1.0", - "http-body 1.0.0", + "h2", + "http", + "http-body", "httparse", + "httpdate", "itoa", "pin-project-lite", "smallvec", @@ -609,8 +546,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" dependencies = [ "futures-util", - "http 1.1.0", - "hyper 1.4.1", + "http", + "hyper", "hyper-util", "rustls", "rustls-pki-types", @@ -628,7 +565,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.4.1", + "hyper", "hyper-util", "native-tls", "tokio", @@ -645,9 +582,9 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "hyper 1.4.1", + "http", + "http-body", + "hyper", "pin-project-lite", "socket2", "tokio", @@ -713,9 +650,9 @@ checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" [[package]] name = "iter-read" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a598c1abae8e3456ebda517868b254b6bc2a9bb6501ffd5b9d0875bf332e048b" +checksum = "071ed4cc1afd86650602c7b11aa2e1ce30762a1c27193201cb5cee9c6ebb1294" [[package]] name = "itoa" @@ -816,14 +753,19 @@ dependencies = [ [[package]] name = "mockito" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2f6e023aa5bdf392aa06c78e4a4e6d498baab5138d0c993503350ebbc37bf1e" +checksum = "09b34bd91b9e5c5b06338d392463e1318d683cf82ec3d3af4014609be6e2108d" dependencies = [ "assert-json-diff", + "bytes", "colored", - "futures-core", - "hyper 0.14.30", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", "log", "rand", "regex", @@ -1188,11 +1130,11 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2 0.4.5", - "http 1.1.0", - "http-body 1.0.0", + "h2", + "http", + "http-body", "http-body-util", - "hyper 1.4.1", + "hyper", "hyper-rustls", "hyper-tls", "hyper-util", @@ -1357,18 +1299,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.204" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.204" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 1ec0ded..2aabe2c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,9 @@ [package] -authors = ["Nelson Chen "] +name = "speedtest-rs" description = "Speedtest.net testing utility and crate" +authors = ["Nelson Chen "] exclude = ["tests/config/*"] license = "MIT OR Apache-2.0" -name = "speedtest-rs" repository = "https://github.com/nelsonjchen/speedtest-rs" version = "0.2.0" edition = "2021" @@ -14,20 +14,19 @@ name = "speedtest_rs" [[bin]] name = "speedtest-rs" -required-features = ["clap"] [dependencies] -clap = { version = "<=4.4", features = ["derive"], optional = true } +clap = { version = "<=4.4", features = ["derive"] } chrono = "0.4.38" log = { version = "0.4.22", optional = true } url = "2.5.2" -mockito = "1.4.0" +mockito = "1.5.0" md5 = "0.7.0" csv = "1.3.0" -serde = { version = "1.0.204", features = ["derive"] } +serde = { version = "1.0.210", features = ["derive"] } roxmltree = "0.20.0" rayon = "1.10.0" -iter-read = "1.0.1" +iter-read = "1.1.0" tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } tracing = "0.1.40" @@ -37,5 +36,3 @@ features = ["blocking"] [features] rustls-tls = ["reqwest/rustls-tls"] -log = ["dep:log"] -clap = ["dep:clap"] diff --git a/src/main.rs b/src/main.rs index fff52b4..c82e477 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,6 +10,7 @@ use chrono::Utc; use clap::Parser; use std::io::{self, Write}; use tracing::info; +use tracing_subscriber::{fmt, prelude::*, EnvFilter}; use url::Url; #[derive(Parser)] @@ -58,6 +59,11 @@ struct Cli { } fn main() -> Result<(), error::SpeedTestError> { + tracing_subscriber::registry() + .with(fmt::layer()) + .with(EnvFilter::from_default_env()) + .init(); + let matches = Cli::parse(); // This appears to be purely informational. From 41c2d686f95d90d8dc2da1c1da55927de2f54098 Mon Sep 17 00:00:00 2001 From: Dilawar Singh Date: Sat, 12 Oct 2024 19:08:10 +0530 Subject: [PATCH 3/4] adds version 0.17.0 to jobs --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b5303be..6ead08c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,7 @@ jobs: strategy: matrix: rust: + - 1.70.0 - stable - beta - nightly From ed493ad55a30f8d0db6c7207339e3e1f44d2846c Mon Sep 17 00:00:00 2001 From: Dilawar Singh Date: Sat, 12 Oct 2024 19:18:20 +0530 Subject: [PATCH 4/4] lifetimes elided --- src/speedtest.rs | 2 +- src/speedtest_csv.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/speedtest.rs b/src/speedtest.rs index 7c4e22c..cf00d22 100644 --- a/src/speedtest.rs +++ b/src/speedtest.rs @@ -400,7 +400,7 @@ pub struct SpeedTestResult<'a, 'b, 'c> { pub latency_measurement: &'c SpeedTestLatencyTestResult<'c>, } -impl<'a, 'b, 'c> SpeedTestResult<'a, 'b, 'c> { +impl SpeedTestResult<'_, '_, '_> { pub fn hash(&self) -> String { let hashed_str = format!( "{}-{}-{}-{}", diff --git a/src/speedtest_csv.rs b/src/speedtest_csv.rs index 5bbf4a0..ecd9487 100644 --- a/src/speedtest_csv.rs +++ b/src/speedtest_csv.rs @@ -24,7 +24,7 @@ pub struct SpeedTestCsvResult<'a> { pub ip_address: &'a str, } -impl<'a> SpeedTestCsvResult<'a> { +impl SpeedTestCsvResult<'_> { pub fn header_serialize(self) -> String { // Un-dynamic for now // Blocked on: