From d94d3adb87d2f4ed435b55ce95840cda72a32c00 Mon Sep 17 00:00:00 2001 From: Ho Kim Date: Thu, 14 Nov 2024 13:52:52 +0000 Subject: [PATCH] fix: pass cargo clippy --- Cargo.toml | 2 +- crates/cassette-core/src/data/actor/mod.rs | 6 +- .../cassette-plugin-webcam-core/src/hooks.rs | 2 +- .../cassette/src/components/actor/number.rs | 2 +- crates/cassette/src/components/load.rs | 2 +- crates/cassette/src/pages/profile.rs | 4 +- deny.toml | 138 ++++++++++++++++++ 7 files changed, 147 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 55adc04..266dba6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -97,7 +97,7 @@ uuid = { version = "=1.11", default-features = false, features = [ "serde", "v4", ] } -wasm-bindgen = { version = "=0.2" } +wasm-bindgen = { version = "=0.2.93" } # FIXME: wait <=0.2.93 until issue is resolved: https://github.com/rustwasm/wasm-pack/issues/1441 wasm-streams = { version = "=0.4" } web-sys = { version = "=0.3", features = [ "FileList", diff --git a/crates/cassette-core/src/data/actor/mod.rs b/crates/cassette-core/src/data/actor/mod.rs index 539f209..4510a8a 100644 --- a/crates/cassette-core/src/data/actor/mod.rs +++ b/crates/cassette-core/src/data/actor/mod.rs @@ -60,7 +60,7 @@ impl FromStr for SchemaPath { .map(|item| { item.parse() .map(SchemaPathItem::List) - .unwrap_or_else(|_| SchemaPathItem::Object(item.into())) + .unwrap_or(SchemaPathItem::Object(item)) }) .collect(), )) @@ -97,7 +97,7 @@ impl<'de> Deserialize<'de> for SchemaPath { { struct SchemaPathVisitor; - impl<'de> de::Visitor<'de> for SchemaPathVisitor { + impl de::Visitor<'_> for SchemaPathVisitor { type Value = SchemaPath; #[inline] @@ -168,7 +168,7 @@ impl SchemaPath { let mut map = Map::default(); map.insert(i.clone(), Value::Null); *target = Value::Object(map); - target.get_mut(&i).unwrap() + target.get_mut(i).unwrap() } }, }; diff --git a/crates/cassette-plugin-webcam-core/src/hooks.rs b/crates/cassette-plugin-webcam-core/src/hooks.rs index 87456a2..b094cbb 100644 --- a/crates/cassette-plugin-webcam-core/src/hooks.rs +++ b/crates/cassette-plugin-webcam-core/src/hooks.rs @@ -200,7 +200,7 @@ impl Session { // Start sending Blob if ws.ready_state() == WebSocket::OPEN { - ws.send_with_blob(&blob) + ws.send_with_blob(blob) .expect("Failed to send data via WebSocket") } } diff --git a/crates/cassette/src/components/actor/number.rs b/crates/cassette/src/components/actor/number.rs index b4f1dad..7e847f7 100644 --- a/crates/cassette/src/components/actor/number.rs +++ b/crates/cassette/src/components/actor/number.rs @@ -24,7 +24,7 @@ pub fn build_form( }) }; - let build_default = || Number::from(0 as u8); + let build_default = || Number::from(0u8); let value = match default { Value::Bool(value) => Number::from(*value as u8), Value::Number(value) => value.clone(), diff --git a/crates/cassette/src/components/load.rs b/crates/cassette/src/components/load.rs index 7d60d19..d4c2b0f 100644 --- a/crates/cassette/src/components/load.rs +++ b/crates/cassette/src/components/load.rs @@ -81,7 +81,7 @@ fn use_fetch( uri: if query.is_empty() { uri } else { - uri.push_str("?"); + uri.push('?'); for (index, (key, value)) in query.iter().enumerate() { if index > 0 { uri.push('&'); diff --git a/crates/cassette/src/pages/profile.rs b/crates/cassette/src/pages/profile.rs index 4bc683f..2f69f00 100644 --- a/crates/cassette/src/pages/profile.rs +++ b/crates/cassette/src/pages/profile.rs @@ -287,7 +287,7 @@ enum KeyColumns { Value, } -impl<'a> TableEntryRenderer for Entry<'a> { +impl TableEntryRenderer for Entry<'_> { fn render_cell(&self, ctx: CellContext) -> Cell { let Self { key, value, link } = self; match ctx.column { @@ -325,7 +325,7 @@ enum VersionColumns { Version, } -impl<'a> TableEntryRenderer for Entry<'a> { +impl TableEntryRenderer for Entry<'_> { fn render_cell(&self, ctx: CellContext) -> Cell { let Self { key, value, link } = self; match ctx.column { diff --git a/deny.toml b/deny.toml index 53c6fee..a1ec404 100644 --- a/deny.toml +++ b/deny.toml @@ -74,8 +74,13 @@ ignore = [ #{ id = "RUSTSEC-0000-0000", reason = "you can specify a reason the advisory is ignored" }, #"a-crate-that-is-yanked@0.1.1", # you can also ignore yanked crate versions if you wish #{ crate = "a-crate-that-is-yanked@0.1.1", reason = "you can specify why you are ignoring the yanked crate" }, + { id = "RUSTSEC-2023-0086", reason = "Uncontrollable crate: anstyle-query" }, + { id = "RUSTSEC-2024-0320", reason = "Uncontrollable crate: yaml-rust" }, { id = "RUSTSEC-2024-0336", reason = "Pending to release the external package: actix-web" }, { id = "RUSTSEC-2024-0358", reason = "Pending to release the external package: deltalake" }, + { id = "RUSTSEC-2024-0370", reason = "Uncontrollable crate: proc-macro-error" }, + { id = "RUSTSEC-2024-0384", reason = "Uncontrollable crate: instant" }, + { id = "RUSTSEC-2024-0388", reason = "Uncontrollable crate: derivative" }, ] # If this is true, then cargo deny will use the git executable to fetch advisory database. # If this is false, then it uses a built-in git library. @@ -102,6 +107,7 @@ allow = [ "LicenseRef-ring", "MIT", "MPL-2.0", + "Unicode-3.0", "Unicode-DFS-2016", "Unlicense", ] @@ -120,10 +126,142 @@ confidence-threshold = 0.8 allow = ["GPL-3.0 WITH Classpath-exception-2.0"] crate = "ark-core" +[[licenses.exceptions]] +allow = ["GPL-3.0 WITH Classpath-exception-2.0"] +crate = "ark-api" + [[licenses.exceptions]] allow = ["GPL-3.0 WITH Classpath-exception-2.0"] crate = "ark-core-k8s" +[[licenses.exceptions]] +allow = ["AGPL-3.0"] +crate = "cassette" + +[[licenses.exceptions]] +allow = ["AGPL-3.0"] +crate = "cassette-core" + +[[licenses.exceptions]] +allow = ["AGPL-3.0"] +crate = "cassette-gateway" + +[[licenses.exceptions]] +allow = ["AGPL-3.0"] +crate = "cassette-loader-core" + +[[licenses.exceptions]] +allow = ["AGPL-3.0"] +crate = "cassette-loader-file" + +[[licenses.exceptions]] +allow = ["AGPL-3.0"] +crate = "cassette-operator" + +[[licenses.exceptions]] +allow = ["AGPL-3.0"] +crate = "cassette-plugin-cdl-api" + +[[licenses.exceptions]] +allow = ["AGPL-3.0"] +crate = "cassette-plugin-cdl-catalog" + +[[licenses.exceptions]] +allow = ["AGPL-3.0"] +crate = "cassette-plugin-cdl-core" + +[[licenses.exceptions]] +allow = ["AGPL-3.0"] +crate = "cassette-plugin-cdl-dataset-browser" + +[[licenses.exceptions]] +allow = ["AGPL-3.0"] +crate = "cassette-plugin-cdl-dataset-stream-reader" + +[[licenses.exceptions]] +allow = ["AGPL-3.0"] +crate = "cassette-plugin-cdl-zone" + +[[licenses.exceptions]] +allow = ["AGPL-3.0"] +crate = "cassette-plugin-helm-api" + +[[licenses.exceptions]] +allow = ["AGPL-3.0"] +crate = "cassette-plugin-helm-core" + +[[licenses.exceptions]] +allow = ["AGPL-3.0"] +crate = "cassette-plugin-jwt" + +[[licenses.exceptions]] +allow = ["AGPL-3.0"] +crate = "cassette-plugin-kubernetes-api" + +[[licenses.exceptions]] +allow = ["AGPL-3.0"] +crate = "cassette-plugin-kubernetes-core" + +[[licenses.exceptions]] +allow = ["AGPL-3.0"] +crate = "cassette-plugin-kubernetes-list" + +[[licenses.exceptions]] +allow = ["AGPL-3.0"] +crate = "cassette-plugin-openai-chat" + +[[licenses.exceptions]] +allow = ["AGPL-3.0"] +crate = "cassette-plugin-webcam-audio" + +[[licenses.exceptions]] +allow = ["AGPL-3.0"] +crate = "cassette-plugin-webcam-core" + +[[licenses.exceptions]] +allow = ["GPL-3.0 WITH Classpath-exception-2.0"] +crate = "dash-api" + +[[licenses.exceptions]] +allow = ["GPL-3.0 WITH Classpath-exception-2.0"] +crate = "dash-pipe-api" + +[[licenses.exceptions]] +allow = ["GPL-3.0 WITH Classpath-exception-2.0"] +crate = "dash-pipe-provider" + +[[licenses.exceptions]] +allow = ["GPL-3.0 WITH Classpath-exception-2.0"] +crate = "dash-provider" + +[[licenses.exceptions]] +allow = ["GPL-3.0 WITH Classpath-exception-2.0"] +crate = "dash-provider-api" + +[[licenses.exceptions]] +allow = ["GPL-3.0 WITH Classpath-exception-2.0"] +crate = "kiss-api" + +[[licenses.exceptions]] +allow = ["GPL-3.0 WITH Classpath-exception-2.0"] +crate = "straw-api" + +[[licenses.exceptions]] +allow = ["GPL-3.0 WITH Classpath-exception-2.0"] +crate = "vine-api" + +[[licenses.exceptions]] +allow = ["GPL-3.0 WITH Classpath-exception-2.0"] +crate = "vine-rbac" + +[[licenses.exceptions]] +allow = ["GPL-3.0 WITH Classpath-exception-2.0"] +crate = "vine-session" + +[[licenses.exceptions]] +allow = ["GPL-3.0 WITH Classpath-exception-2.0"] +crate = "vine-storage" + # Some crates don't have (easily) machine readable licensing information, # adding a clarification entry for it allows you to manually specify the # licensing information