Skip to content

Commit

Permalink
fix: pass cargo clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
HoKim98 committed Nov 14, 2024
1 parent 5e67e74 commit d94d3ad
Show file tree
Hide file tree
Showing 7 changed files with 147 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions crates/cassette-core/src/data/actor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
))
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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()
}
},
};
Expand Down
2 changes: 1 addition & 1 deletion crates/cassette-plugin-webcam-core/src/hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/cassette/src/components/actor/number.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion crates/cassette/src/components/load.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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('&');
Expand Down
4 changes: 2 additions & 2 deletions crates/cassette/src/pages/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ enum KeyColumns {
Value,
}

impl<'a> TableEntryRenderer<KeyColumns> for Entry<'a> {
impl TableEntryRenderer<KeyColumns> for Entry<'_> {
fn render_cell(&self, ctx: CellContext<KeyColumns>) -> Cell {
let Self { key, value, link } = self;
match ctx.column {
Expand Down Expand Up @@ -325,7 +325,7 @@ enum VersionColumns {
Version,
}

impl<'a> TableEntryRenderer<VersionColumns> for Entry<'a> {
impl TableEntryRenderer<VersionColumns> for Entry<'_> {
fn render_cell(&self, ctx: CellContext<VersionColumns>) -> Cell {
let Self { key, value, link } = self;
match ctx.column {
Expand Down
138 changes: 138 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,13 @@ ignore = [
#{ id = "RUSTSEC-0000-0000", reason = "you can specify a reason the advisory is ignored" },
#"[email protected]", # you can also ignore yanked crate versions if you wish
#{ crate = "[email protected]", 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.
Expand All @@ -102,6 +107,7 @@ allow = [
"LicenseRef-ring",
"MIT",
"MPL-2.0",
"Unicode-3.0",
"Unicode-DFS-2016",
"Unlicense",
]
Expand All @@ -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
Expand Down

0 comments on commit d94d3ad

Please sign in to comment.