From 9c774147fd7975e7baeaa69234e96d4085af1644 Mon Sep 17 00:00:00 2001 From: Hayden Stainsby Date: Thu, 24 Aug 2023 18:36:47 +0200 Subject: [PATCH] chore: updates for Rust 1.72.0 (#459) Clippy was complaining about 3 new things in 1.72.0. Two new lints and one updated one. When `futures-core` was added as an explicit dependency on `console-api` in #453, it was only added to the `console-api` Cargo.toml file. It wasn't added to the Cargo.lock file shared by the workspace. Since Rust 1.72.0, Cargo is adding this dependency to Cargo.lock locally, so it makes sense to check in that change. --- Cargo.lock | 1 + tokio-console/src/state/mod.rs | 4 ++-- tokio-console/src/state/store.rs | 5 +---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 27d4c3088..9e73cde34 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -257,6 +257,7 @@ dependencies = [ name = "console-api" version = "0.5.0" dependencies = [ + "futures-core", "prost", "prost-build", "prost-types", diff --git a/tokio-console/src/state/mod.rs b/tokio-console/src/state/mod.rs index 982e816b9..4b908864b 100644 --- a/tokio-console/src/state/mod.rs +++ b/tokio-console/src/state/mod.rs @@ -93,7 +93,7 @@ impl State { mut self, linters: impl IntoIterator>, ) -> Self { - self.tasks_state.linters.extend(linters.into_iter()); + self.tasks_state.linters.extend(linters); self } @@ -505,7 +505,7 @@ fn truncate_registry_path(s: String) -> String { static REGEX: OnceCell = OnceCell::new(); let regex = REGEX.get_or_init(|| { - Regex::new(r#".*/\.cargo(/registry/src/[^/]*/|/git/checkouts/)"#) + Regex::new(r".*/\.cargo(/registry/src/[^/]*/|/git/checkouts/)") .expect("failed to compile regex") }); diff --git a/tokio-console/src/state/store.rs b/tokio-console/src/state/store.rs index 79a048a5b..f365585cd 100644 --- a/tokio-console/src/state/store.rs +++ b/tokio-console/src/state/store.rs @@ -191,10 +191,7 @@ impl fmt::Debug for Ids { impl Clone for Id { #[inline] fn clone(&self) -> Self { - Self { - id: self.id, - _ty: PhantomData, - } + *self } }