This repository has been archived by the owner on Oct 19, 2024. It is now read-only.
Finish most + pyro integration #3671
Annotations
44 warnings
deref which would be done by auto-deref:
src/routes/v3/payouts.rs#L737
warning: deref which would be done by auto-deref
--> src/routes/v3/payouts.rs:737:52
|
737 | let balance = get_user_balance(user.id.into(), &**pool).await?;
| ^^^^^^^ help: try: `&pool`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
|
deref which would be done by auto-deref:
src/routes/v3/payouts.rs#L355
warning: deref which would be done by auto-deref
--> src/routes/v3/payouts.rs:355:52
|
355 | let balance = get_user_balance(user.id.into(), &**pool).await?;
| ^^^^^^^ help: try: `&pool`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
|
useless conversion to the same type: `database::models::ids::UserId`:
src/routes/v3/payouts.rs#L355
warning: useless conversion to the same type: `database::models::ids::UserId`
--> src/routes/v3/payouts.rs:355:36
|
355 | let balance = get_user_balance(user.id.into(), &**pool).await?;
| ^^^^^^^^^^^^^^ help: consider removing `.into()`: `user.id`
|
= 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
|
match can be simplified with `.unwrap_or_default()`:
src/routes/v2/version_creation.rs#L109
warning: match can be simplified with `.unwrap_or_default()`
--> src/routes/v2/version_creation.rs:109:44
|
109 | Ok(loader_response) => match v2_reroute::extract_ok_json::<
| ____________________________________________^
110 | | Vec<v3::tags::LoaderData>,
111 | | >(loader_response)
112 | | .await
... |
115 | | Err(_) => vec![],
116 | | },
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default
= note: `#[warn(clippy::manual_unwrap_or_default)]` on by default
help: replace it with
|
109 ~ Ok(loader_response) => (v2_reroute::extract_ok_json::<
110 + Vec<v3::tags::LoaderData>,
111 + >(loader_response)
112 ~ .await).unwrap_or_default(),
|
|
redundant closure:
src/routes/internal/gdpr.rs#L158
warning: redundant closure
--> src/routes/internal/gdpr.rs:158:14
|
158 | .map(|x| crate::models::billing::UserSubscription::from(x))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `crate::models::billing::UserSubscription::from`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
|
redundant closure:
src/routes/internal/gdpr.rs#L149
warning: redundant closure
--> src/routes/internal/gdpr.rs:149:18
|
149 | .map(|x| crate::models::images::Image::from(x))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `crate::models::images::Image::from`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
|
redundant closure:
src/routes/internal/gdpr.rs#L113
warning: redundant closure
--> src/routes/internal/gdpr.rs:113:14
|
113 | .map(|x| crate::models::reports::Report::from(x))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `crate::models::reports::Report::from`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
|
redundant closure:
src/routes/internal/gdpr.rs#L105
warning: redundant closure
--> src/routes/internal/gdpr.rs:105:14
|
105 | .map(|x| crate::models::payouts::Payout::from(x))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `crate::models::payouts::Payout::from`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
|
redundant closure:
src/routes/internal/gdpr.rs#L84
warning: redundant closure
--> src/routes/internal/gdpr.rs:84:14
|
84 | .map(|x| crate::models::oauth_clients::OAuthClientAuthorization::from(x))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `crate::models::oauth_clients::OAuthClientAuthorization::from`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
|
redundant closure:
src/routes/internal/gdpr.rs#L76
warning: redundant closure
--> src/routes/internal/gdpr.rs:76:14
|
76 | .map(|x| crate::models::oauth_clients::OAuthClient::from(x))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `crate::models::oauth_clients::OAuthClient::from`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
|
redundant closure:
src/routes/internal/gdpr.rs#L67
warning: redundant closure
--> src/routes/internal/gdpr.rs:67:10
|
67 | .map(|x| crate::models::notifications::Notification::from(x))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `crate::models::notifications::Notification::from`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
|
redundant closure:
src/routes/internal/gdpr.rs#L49
warning: redundant closure
--> src/routes/internal/gdpr.rs:49:14
|
49 | .map(|x| crate::models::ids::ProjectId::from(x))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `crate::models::ids::ProjectId::from`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
|
redundant closure:
src/routes/internal/gdpr.rs#L43
warning: redundant closure
--> src/routes/internal/gdpr.rs:43:14
|
43 | .map(|x| crate::models::ids::ProjectId::from(x))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `crate::models::ids::ProjectId::from`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
|
redundant closure:
src/routes/internal/gdpr.rs#L37
warning: redundant closure
--> src/routes/internal/gdpr.rs:37:18
|
37 | .map(|x| crate::models::collections::Collection::from(x))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `crate::models::collections::Collection::from`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
= note: `#[warn(clippy::redundant_closure)]` on by default
|
deref which would be done by auto-deref:
src/routes/internal/gdpr.rs#L24
warning: deref which would be done by auto-deref
--> src/routes/internal/gdpr.rs:24:9
|
24 | &*session_queue,
| ^^^^^^^^^^^^^^^ help: try: `&session_queue`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
= note: `#[warn(clippy::explicit_auto_deref)]` on by default
|
the borrowed expression implements the required traits:
src/routes/internal/flows.rs#L1396
warning: the borrowed expression implements the required traits
--> src/routes/internal/flows.rs:1396:15
|
1396 | .post(&format!(
| _______________^
1397 | | "https://api.beehiiv.com/v2/publications/{id}/subscriptions"
1398 | | ))
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
help: change this to
|
1396 ~ .post(format!(
1397 + "https://api.beehiiv.com/v2/publications/{id}/subscriptions"
1398 ~ ))
|
|
the borrowed expression implements the required traits:
src/routes/internal/flows.rs#L769
warning: the borrowed expression implements the required traits
--> src/routes/internal/flows.rs:769:26
|
769 | .get(&format!(
| __________________________^
770 | | "{api_url}identity/openidconnect/userinfo?schema=openid"
771 | | ))
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
help: change this to
|
769 ~ .get(format!(
770 + "{api_url}identity/openidconnect/userinfo?schema=openid"
771 ~ ))
|
|
the borrowed expression implements the required traits:
src/routes/internal/flows.rs#L513
warning: the borrowed expression implements the required traits
--> src/routes/internal/flows.rs:513:27
|
513 | .post(&format!("{api_url}oauth2/token"))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("{api_url}oauth2/token")`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
called `is_some()` after searching an `Iterator` with `find`:
src/routes/internal/billing.rs#L726
warning: called `is_some()` after searching an `Iterator` with `find`
--> src/routes/internal/billing.rs:726:26
|
726 | .find(|x| x.product_id == product.id)
| __________________________^
727 | | .is_some()
| |__________________________________^ help: consider using: `any(|x| x.product_id == product.id)`
|
= 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
|
the borrowed expression implements the required traits:
src/queue/payouts.rs#L77
warning: the borrowed expression implements the required traits
--> src/queue/payouts.rs:77:19
|
77 | .post(&format!("{}oauth2/token", dotenvy::var("PAYPAL_API_URL")?))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("{}oauth2/token", dotenvy::var("PAYPAL_API_URL")?)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
the borrowed expression implements the required traits:
src/file_hosting/backblaze/delete.rs#L18
warning: the borrowed expression implements the required traits
--> src/file_hosting/backblaze/delete.rs:18:15
|
18 | .post(&format!(
| _______________^
19 | | "{}/b2api/v2/b2_delete_file_version",
20 | | authorization_data.api_url
21 | | ))
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
help: change this to
|
18 ~ .post(format!(
19 + "{}/b2api/v2/b2_delete_file_version",
20 + authorization_data.api_url
21 ~ ))
|
|
unused variable: `edit_subscription`:
src/routes/internal/billing.rs#L119
warning: unused variable: `edit_subscription`
--> src/routes/internal/billing.rs:119:5
|
119 | edit_subscription: web::Json<SubscriptionEdit>,
| ^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_edit_subscription`
|
= note: `#[warn(unused_variables)]` on by default
|
this function depends on never type fallback being `()`:
src/queue/analytics.rs#L67
warning: this function depends on never type fallback being `()`
--> src/queue/analytics.rs:67:5
|
67 | / pub async fn index(
68 | | &self,
69 | | client: clickhouse::Client,
70 | | redis: &RedisPool,
71 | | pool: &PgPool,
72 | | ) -> Result<(), ApiError> {
| |_____________________________^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the types explicitly
note: in edition 2024, the requirement `!: redis::FromRedisValue` will fail
--> src/queue/analytics.rs:143:18
|
143 | pipe.query_async(&mut *redis)
| ^^^^^^^^^^^
|
this function depends on never type fallback being `()`:
src/database/redis.rs#L504
warning: this function depends on never type fallback being `()`
--> src/database/redis.rs:504:5
|
504 | / pub async fn delete_many(
505 | | &mut self,
506 | | iter: impl IntoIterator<Item = (&str, Option<String>)>,
507 | | ) -> Result<(), DatabaseError> {
| |__________________________________^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the types explicitly
note: in edition 2024, the requirement `!: redis::FromRedisValue` will fail
--> src/database/redis.rs:521:13
|
521 | redis_execute(&mut cmd, &mut self.connection).await?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
this function depends on never type fallback being `()`:
src/database/redis.rs#L491
warning: this function depends on never type fallback being `()`
--> src/database/redis.rs:491:5
|
491 | / pub async fn delete<T1>(&mut self, namespace: &str, id: T1) -> Result<(), DatabaseError>
492 | | where
493 | | T1: Display,
| |____________________^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the types explicitly
note: in edition 2024, the requirement `!: redis::FromRedisValue` will fail
--> src/database/redis.rs:500:9
|
500 | redis_execute(&mut cmd, &mut self.connection).await?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
this function depends on never type fallback being `()`:
src/database/redis.rs#L421
warning: this function depends on never type fallback being `()`
--> src/database/redis.rs:421:5
|
421 | / pub async fn set(
422 | | &mut self,
423 | | namespace: &str,
424 | | id: &str,
425 | | data: &str,
426 | | expiry: Option<i64>,
427 | | ) -> Result<(), DatabaseError> {
| |__________________________________^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the types explicitly
note: in edition 2024, the requirement `!: redis::FromRedisValue` will fail
--> src/database/redis.rs:439:9
|
439 | redis_execute(&mut cmd, &mut self.connection).await?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
this function depends on never type fallback being `()`:
src/database/redis.rs#L133
warning: this function depends on never type fallback being `()`
--> src/database/redis.rs:133:5
|
133 | / pub async fn get_cached_keys_raw_with_slug<F, Fut, T, I, K, S>(
134 | | &self,
135 | | namespace: &str,
136 | | slug_namespace: Option<&str>,
... |
146 | | K: Display + Hash + Eq + PartialEq + Clone + DeserializeOwned + Serialize,
147 | | S: Display + Clone + DeserializeOwned + Serialize + Debug,
| |__________________________________________________________________^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the types explicitly
note: in edition 2024, the requirement `!: redis::FromRedisValue` will fail
--> src/database/redis.rs:366:22
|
366 | pipe.query_async(&mut connection).await?;
| ^^^^^^^^^^^
= note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default
|
this `else { if .. }` block can be collapsed:
src/routes/internal/billing.rs#L1526
warning: this `else { if .. }` block can be collapsed
--> src/routes/internal/billing.rs:1526:44
|
1526 | ... } else {
| ______________________________^
1527 | | ... if let Some(ref mut subscription) = subscription {
1528 | | ... subscription.status = SubscriptionStatus::PaymentFailed;
1529 | | ... }
1530 | | ... }
| |_______________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if
help: collapse nested if block
|
1526 ~ } else if let Some(ref mut subscription) = subscription {
1527 + subscription.status = SubscriptionStatus::PaymentFailed;
1528 + }
|
|
this `else { if .. }` block can be collapsed:
src/routes/internal/billing.rs#L1118
warning: this `else { if .. }` block can be collapsed
--> src/routes/internal/billing.rs:1118:40
|
1118 | ... } else {
| ______________________________^
1119 | | ... if let Some(PaymentRequestMetadata::Pyro {
1120 | | ... server_name,
1121 | | ... source,
... |
1148 | | ... }
1149 | | ... }
| |_______________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if
= note: `#[warn(clippy::collapsible_else_if)]` on by default
help: collapse nested if block
|
1118 ~ } else if let Some(PaymentRequestMetadata::Pyro {
1119 + server_name,
1120 + source,
1121 + }) = &metadata.payment_metadata
1122 + {
1123 + let server_name =
1124 + server_name.clone().unwrap_or_else(|| {
1125 + format!("{}'s server", metadata.user_item.username)
1126 + });
1127 +
1128 + let res = client
1129 + .post("https://archon.pyro.host/v0/servers/create")
1130 + .header("X-Master-Key", dotenvy::var("PYRO_API_KEY")?)
1131 + .json(&serde_json::json!({
1132 + "user_id": to_base62(metadata.user_item.id.0 as u64),
1133 + "name": server_name,
1134 + "specs": {
1135 + "ram": ram,
1136 + "cpu": std::cmp::max(2, (ram / 1024) / 2),
1137 + "swap": ram / 4,
1138 + },
1139 + "source": source,
1140 + }))
1141 + .send()
1142 + .await;
1143 +
1144 + if let Err(e) = res {
1145 + warn!("Error creating pyro server: {:?}", e);
1146 + }
1147 + }
|
|
docker
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2, docker/metadata-action@v3, docker/login-action@v1, docker/build-push-action@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
docker
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v2, docker/metadata-action@v3, docker/login-action@v1, docker/build-push-action@v2. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
docker
The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
docker
The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
docker
The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
docker
The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
docker
The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
docker
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
docker
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
docker
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
docker
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
docker
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
docker
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
docker
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
docker
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|