From 0943da51fb25e16414d62e41428423f6d409f944 Mon Sep 17 00:00:00 2001 From: Fletcher Nichol Date: Fri, 14 Jun 2024 10:13:26 -0600 Subject: [PATCH 1/5] build(deps): update to Rust 1.79.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Updated input 'rust-overlay': 'github:oxalica/rust-overlay/bedc47af18fc41bb7d2edc2b212d59ca36253f59' (2024-06-11) → 'github:oxalica/rust-overlay/419e7fae2731f41dd9b3e34dfe8802be68558b92' (2024-06-14) Signed-off-by: Fletcher Nichol --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index b167df906a..8c5686549a 100644 --- a/flake.lock +++ b/flake.lock @@ -51,11 +51,11 @@ ] }, "locked": { - "lastModified": 1718072316, - "narHash": "sha256-p33h73iQ1HkLalCplV5MH0oP3HXRaH3zufnFqb5//ps=", + "lastModified": 1718331519, + "narHash": "sha256-6Ru37wS8uec626nHVIh6hSpCYB7eNc3RPFa2U//bhw4=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "bedc47af18fc41bb7d2edc2b212d59ca36253f59", + "rev": "419e7fae2731f41dd9b3e34dfe8802be68558b92", "type": "github" }, "original": { From b831493195146420c58e3d6af9a795bc5a289cc6 Mon Sep 17 00:00:00 2001 From: Fletcher Nichol Date: Fri, 14 Jun 2024 12:46:09 -0600 Subject: [PATCH 2/5] chore(module-index): remove unused PosthogClient extractor This was found from a lint error that the inner/extracted `PosthogClient` was never being used for anything! Signed-off-by: Fletcher Nichol --- lib/module-index-server/src/extract.rs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/lib/module-index-server/src/extract.rs b/lib/module-index-server/src/extract.rs index a750ce348e..5e753e6e93 100644 --- a/lib/module-index-server/src/extract.rs +++ b/lib/module-index-server/src/extract.rs @@ -11,20 +11,6 @@ use ulid::Ulid; use super::app_state::AppState; use crate::jwt_key::{JwtKeyError, JwtPublicSigningKey}; -pub struct PosthogClient(pub super::app_state::PosthogClient); - -#[async_trait] -impl FromRequestParts for PosthogClient { - type Rejection = (StatusCode, Json); - - async fn from_request_parts( - _parts: &mut Parts, - state: &AppState, - ) -> Result { - Ok(Self(state.posthog_client().clone())) - } -} - pub struct ExtractedS3Bucket(pub S3Bucket); #[async_trait] From 4cde84291a58cffada0603e861ad21ce97f7d339 Mon Sep 17 00:00:00 2001 From: Fletcher Nichol Date: Fri, 14 Jun 2024 12:51:54 -0600 Subject: [PATCH 3/5] style(dal): prefer `.unwrap_or_default` to match with default See: https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default Signed-off-by: Fletcher Nichol --- lib/dal/src/socket/debug.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/dal/src/socket/debug.rs b/lib/dal/src/socket/debug.rs index 568e47ed21..b3e98f9257 100644 --- a/lib/dal/src/socket/debug.rs +++ b/lib/dal/src/socket/debug.rs @@ -78,10 +78,8 @@ impl SocketDebugView { .into_iter() .map(|f| f.to_string()) .collect(); - let path = match AttributeValue::get_path_for_id(ctx, attribute_value_id).await? { - Some(path) => path, - None => String::new(), - }; + let path = + (AttributeValue::get_path_for_id(ctx, attribute_value_id).await?).unwrap_or_default(); let view = attribute_value.view(ctx).await?; let inferred_connections: Vec = @@ -126,10 +124,8 @@ impl SocketDebugView { .into_iter() .map(|f| f.to_string()) .collect(); - let path = match AttributeValue::get_path_for_id(ctx, attribute_value_id).await? { - Some(path) => path, - None => String::new(), - }; + let path = + (AttributeValue::get_path_for_id(ctx, attribute_value_id).await?).unwrap_or_default(); let value_view = attribute_value.view(ctx).await?; let inferred_connections = Component::find_available_inferred_connections_to_input_socket(ctx, input_socket_match) From 533e864ab51ec3474cd11a8896c128be13ebc61b Mon Sep 17 00:00:00 2001 From: Fletcher Nichol Date: Fri, 14 Jun 2024 12:52:49 -0600 Subject: [PATCH 4/5] chore(naxum): expose message parts extractors as `pub` This fixes an oversight in the original development, causing clippy to find extractors that were never callable. Signed-off-by: Fletcher Nichol --- lib/naxum/src/extract.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/naxum/src/extract.rs b/lib/naxum/src/extract.rs index b000d4e316..4c520cd5a6 100644 --- a/lib/naxum/src/extract.rs +++ b/lib/naxum/src/extract.rs @@ -4,7 +4,7 @@ use async_trait::async_trait; use crate::{message::Head, response::IntoResponse, MessageHead}; -mod message_parts; +pub mod message_parts; pub mod rejection; mod state; mod tuple; From 965761dbee202db280883d6eb23322351213b541 Mon Sep 17 00:00:00 2001 From: Fletcher Nichol Date: Fri, 14 Jun 2024 12:58:21 -0600 Subject: [PATCH 5/5] style(sdf-server): remove unused `.enumerate` index See: https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index Signed-off-by: Fletcher Nichol --- lib/sdf-server/src/server/service/graphviz.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/sdf-server/src/server/service/graphviz.rs b/lib/sdf-server/src/server/service/graphviz.rs index 51be46ea33..f732be9c1a 100644 --- a/lib/sdf-server/src/server/service/graphviz.rs +++ b/lib/sdf-server/src/server/service/graphviz.rs @@ -138,7 +138,7 @@ pub async fn schema_variant( let rel_edges = workspace_snapshot .get_edges_between_nodes(id, target.id()) .await?; - rel_edges.iter().enumerate().for_each(|(_, edge)| { + rel_edges.iter().for_each(|edge| { edges.push(GraphVizEdge { from: id, to: target.id(), @@ -185,7 +185,7 @@ pub async fn schema_variant( let rel_edges = workspace_snapshot .get_edges_between_nodes(source.id(), id) .await?; - rel_edges.iter().enumerate().for_each(|(_, edge)| { + rel_edges.iter().for_each(|edge| { edges.push(GraphVizEdge { from: source.id(), to: id, @@ -232,7 +232,7 @@ pub async fn schema_variant( let rel_edges = workspace_snapshot .get_edges_between_nodes(cat_inner.id(), func_id) .await?; - rel_edges.iter().enumerate().for_each(|(_, edge)| { + rel_edges.iter().for_each(|edge| { edges.push(GraphVizEdge { from: cat_inner.id(), to: func_id, @@ -269,7 +269,7 @@ pub async fn schema_variant( let rel_edges = workspace_snapshot .get_edges_between_nodes(root_content.id(), cat_inner.id()) .await?; - rel_edges.iter().enumerate().for_each(|(_, edge)| { + rel_edges.iter().for_each(|edge| { edges.push(GraphVizEdge { from: root_content.id(), to: cat_inner.id(), @@ -340,7 +340,7 @@ pub async fn components( let rel_edges = workspace_snapshot .get_edges_between_nodes(id, target.id()) .await?; - rel_edges.iter().enumerate().for_each(|(_, edge)| { + rel_edges.iter().for_each(|edge| { edges.push(GraphVizEdge { from: id, to: target.id(),