Fix slow performace #51
clippy
39 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 39 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.74.0 (79e9716c9 2023-11-13)
- cargo 1.74.0 (ecb9851af 2023-10-18)
- clippy 0.1.74 (79e9716 2023-11-13)
Annotations
Check warning on line 142 in crates/flow-server/src/main.rs
github-actions / clippy
manual implementation of `Option::map`
warning: manual implementation of `Option::map`
--> crates/flow-server/src/main.rs:131:20
|
131 | let auth = if let Some(supabase_auth) = &supabase_auth {
| ____________________^
132 | | Some(
133 | | web::scope("/auth")
134 | | .app_data(web::Data::new(sig_auth))
... |
141 | | None
142 | | };
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map
= note: `#[warn(clippy::manual_map)]` on by default
help: try
|
131 ~ let auth = supabase_auth.as_ref().map(|supabase_auth| web::scope("/auth")
132 + .app_data(web::Data::new(sig_auth))
133 + .app_data(web::Data::new(supabase_auth.clone()))
134 + .service(api::claim_token::service(&config, db.clone()))
135 + .service(api::init_auth::service(&config))
136 ~ .service(api::confirm_auth::service(&config)));
|
Check warning on line 213 in crates/flow-server/src/user.rs
github-actions / clippy
unnecessary closure used to substitute value for `Option::None`
warning: unnecessary closure used to substitute value for `Option::None`
--> crates/flow-server/src/user.rs:210:27
|
210 | let service_key = config
| ___________________________^
211 | | .service_key
212 | | .as_ref()
213 | | .ok_or_else(|| "need service_key")?;
| |______________--------------------------------^
| |
| help: use `ok_or(..)` instead: `ok_or("need service_key")`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
= note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default
Check warning on line 30 in crates/flow-server/src/middleware/auth.rs
github-actions / clippy
a `const` item should never be interior mutable
warning: a `const` item should never be interior mutable
--> crates/flow-server/src/middleware/auth.rs:30:1
|
30 | pub const X_API_KEY: HeaderName = HeaderName::from_static("x-api-key");
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| make this a static item (maybe with lazy_static)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#declare_interior_mutable_const
= note: `#[warn(clippy::declare_interior_mutable_const)]` on by default
Check warning on line 213 in crates/flow-server/src/user.rs
github-actions / clippy
unnecessary closure used to substitute value for `Option::None`
warning: unnecessary closure used to substitute value for `Option::None`
--> crates/flow-server/src/user.rs:210:27
|
210 | let service_key = config
| ___________________________^
211 | | .service_key
212 | | .as_ref()
213 | | .ok_or_else(|| "need service_key")?;
| |______________--------------------------------^
| |
| help: use `ok_or(..)` instead: `ok_or("need service_key")`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
= note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default
Check warning on line 143 in crates/flow-server/src/db_worker/signer.rs
github-actions / clippy
useless conversion to the same type: `serde_json::Value`
warning: useless conversion to the same type: `serde_json::Value`
--> crates/flow-server/src/db_worker/signer.rs:143:29
|
143 | Ok((signer.start(), signers_info.into()))
| ^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `signers_info`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
= note: `#[warn(clippy::useless_conversion)]` on by default
Check warning on line 30 in crates/flow-server/src/middleware/auth.rs
github-actions / clippy
a `const` item should never be interior mutable
warning: a `const` item should never be interior mutable
--> crates/flow-server/src/middleware/auth.rs:30:1
|
30 | pub const X_API_KEY: HeaderName = HeaderName::from_static("x-api-key");
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| make this a static item (maybe with lazy_static)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#declare_interior_mutable_const
= note: `#[warn(clippy::declare_interior_mutable_const)]` on by default
Check warning on line 143 in crates/flow-server/src/db_worker/signer.rs
github-actions / clippy
useless conversion to the same type: `serde_json::Value`
warning: useless conversion to the same type: `serde_json::Value`
--> crates/flow-server/src/db_worker/signer.rs:143:29
|
143 | Ok((signer.start(), signers_info.into()))
| ^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `signers_info`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
= note: `#[warn(clippy::useless_conversion)]` on by default
Check warning on line 351 in crates/flow/src/flow_graph.rs
github-actions / clippy
using `clone` on type `User` which implements the `Copy` trait
warning: using `clone` on type `User` which implements the `Copy` trait
--> crates/flow/src/flow_graph.rs:351:26
|
351 | let started_by = registry.started_by.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `registry.started_by`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
Check warning on line 350 in crates/flow/src/flow_graph.rs
github-actions / clippy
using `clone` on type `User` which implements the `Copy` trait
warning: using `clone` on type `User` which implements the `Copy` trait
--> crates/flow/src/flow_graph.rs:350:26
|
350 | let flow_owner = registry.flow_owner.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `registry.flow_owner`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
= note: `#[warn(clippy::clone_on_copy)]` on by default
Check warning on line 32 in crates/cmds-std/src/postgrest/execute_query.rs
github-actions / clippy
called `is_none()` after searching an `Iterator` with `find`
warning: called `is_none()` after searching an `Iterator` with `find`
--> crates/cmds-std/src/postgrest/execute_query.rs:23:31
|
23 | let contain_auth_header = input
| _______________________________^
24 | | .headers
25 | | .iter()
26 | | .find(|(k, _)| {
... |
31 | | })
32 | | .is_none();
| |__________________^
|
= help: this is more succinctly expressed by calling `any()` with negation
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#search_is_some
= note: `#[warn(clippy::search_is_some)]` on by default
Check warning on line 337 in crates/db/src/connection/proxied_user_conn.rs
github-actions / clippy
this let-binding has unit value
warning: this let-binding has unit value
--> crates/db/src/connection/proxied_user_conn.rs:337:17
|
337 | let res = self.save_signature(&id, &signature).await?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `self.save_signature(&id, &signature).await?;`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
Check warning on line 324 in crates/db/src/connection/proxied_user_conn.rs
github-actions / clippy
this let-binding has unit value
warning: this let-binding has unit value
--> crates/db/src/connection/proxied_user_conn.rs:324:17
|
324 | let res = self.set_node_finish(&id, &node_id, ×, &time).await?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `self.set_node_finish(&id, &node_id, ×, &time).await?;`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
Check warning on line 319 in crates/db/src/connection/proxied_user_conn.rs
github-actions / clippy
this let-binding has unit value
warning: this let-binding has unit value
--> crates/db/src/connection/proxied_user_conn.rs:319:17
|
319 | let res = self.push_node_error(&id, &node_id, ×, &error).await?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `self.push_node_error(&id, &node_id, ×, &error).await?;`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
Check warning on line 313 in crates/db/src/connection/proxied_user_conn.rs
github-actions / clippy
this let-binding has unit value
warning: this let-binding has unit value
--> crates/db/src/connection/proxied_user_conn.rs:311:17
|
311 | / let res = self
312 | | .save_node_output(&id, &node_id, ×, &output)
313 | | .await?;
| |____________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the `let` binding
|
311 ~ self
312 + .save_node_output(&id, &node_id, ×, &output)
313 + .await?;
|
Check warning on line 306 in crates/db/src/connection/proxied_user_conn.rs
github-actions / clippy
this let-binding has unit value
warning: this let-binding has unit value
--> crates/db/src/connection/proxied_user_conn.rs:304:17
|
304 | / let res = self
305 | | .new_node_run(&id, &node_id, ×, &time, &input)
306 | | .await?;
| |____________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the `let` binding
|
304 ~ self
305 + .new_node_run(&id, &node_id, ×, &time, &input)
306 + .await?;
|
Check warning on line 299 in crates/db/src/connection/proxied_user_conn.rs
github-actions / clippy
this let-binding has unit value
warning: this let-binding has unit value
--> crates/db/src/connection/proxied_user_conn.rs:299:17
|
299 | let res = self.set_run_result(&id, &time, ¬_run, &output).await?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `self.set_run_result(&id, &time, ¬_run, &output).await?;`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
Check warning on line 293 in crates/db/src/connection/proxied_user_conn.rs
github-actions / clippy
this let-binding has unit value
warning: this let-binding has unit value
--> crates/db/src/connection/proxied_user_conn.rs:291:17
|
291 | / let res = self
292 | | .push_flow_log(&id, &index, &time, &level, &module, &content)
293 | | .await?;
| |____________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the `let` binding
|
291 ~ self
292 + .push_flow_log(&id, &index, &time, &level, &module, &content)
293 + .await?;
|
Check warning on line 285 in crates/db/src/connection/proxied_user_conn.rs
github-actions / clippy
this let-binding has unit value
warning: this let-binding has unit value
--> crates/db/src/connection/proxied_user_conn.rs:285:17
|
285 | let res = self.push_flow_error(&id, &error).await?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `self.push_flow_error(&id, &error).await?;`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
Check warning on line 280 in crates/db/src/connection/proxied_user_conn.rs
github-actions / clippy
this let-binding has unit value
warning: this let-binding has unit value
--> crates/db/src/connection/proxied_user_conn.rs:280:17
|
280 | let res = self.set_start_time(&id, &time).await?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `self.set_start_time(&id, &time).await?;`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
Check warning on line 245 in crates/db/src/connection/proxied_user_conn.rs
github-actions / clippy
this let-binding has unit value
warning: this let-binding has unit value
--> crates/db/src/connection/proxied_user_conn.rs:245:17
|
245 | let res = self.share_flow_run(id, user).await?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `self.share_flow_run(id, user).await?;`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
= note: `#[warn(clippy::let_unit_value)]` on by default
Check warning on line 337 in crates/db/src/connection/proxied_user_conn.rs
github-actions / clippy
this let-binding has unit value
warning: this let-binding has unit value
--> crates/db/src/connection/proxied_user_conn.rs:337:17
|
337 | let res = self.save_signature(&id, &signature).await?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `self.save_signature(&id, &signature).await?;`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
Check warning on line 324 in crates/db/src/connection/proxied_user_conn.rs
github-actions / clippy
this let-binding has unit value
warning: this let-binding has unit value
--> crates/db/src/connection/proxied_user_conn.rs:324:17
|
324 | let res = self.set_node_finish(&id, &node_id, ×, &time).await?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `self.set_node_finish(&id, &node_id, ×, &time).await?;`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
Check warning on line 319 in crates/db/src/connection/proxied_user_conn.rs
github-actions / clippy
this let-binding has unit value
warning: this let-binding has unit value
--> crates/db/src/connection/proxied_user_conn.rs:319:17
|
319 | let res = self.push_node_error(&id, &node_id, ×, &error).await?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `self.push_node_error(&id, &node_id, ×, &error).await?;`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
Check warning on line 313 in crates/db/src/connection/proxied_user_conn.rs
github-actions / clippy
this let-binding has unit value
warning: this let-binding has unit value
--> crates/db/src/connection/proxied_user_conn.rs:311:17
|
311 | / let res = self
312 | | .save_node_output(&id, &node_id, ×, &output)
313 | | .await?;
| |____________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the `let` binding
|
311 ~ self
312 + .save_node_output(&id, &node_id, ×, &output)
313 + .await?;
|
Check warning on line 306 in crates/db/src/connection/proxied_user_conn.rs
github-actions / clippy
this let-binding has unit value
warning: this let-binding has unit value
--> crates/db/src/connection/proxied_user_conn.rs:304:17
|
304 | / let res = self
305 | | .new_node_run(&id, &node_id, ×, &time, &input)
306 | | .await?;
| |____________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the `let` binding
|
304 ~ self
305 + .new_node_run(&id, &node_id, ×, &time, &input)
306 + .await?;
|