Skip to content

Move charges to DB + fix subscription recurring payments #3669

Move charges to DB + fix subscription recurring payments

Move charges to DB + fix subscription recurring payments #3669

GitHub Actions / clippy failed Oct 2, 2024 in 0s

clippy

14 errors, 8 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 14
Warning 8
Note 0
Help 0

Versions

  • rustc 1.81.0 (eeb90cda1 2024-09-04)
  • cargo 1.81.0 (2dbb1af80 2024-08-20)
  • clippy 0.1.81 (eeb90cd 2024-09-04)

Annotations

Check failure on line 893 in src/routes/internal/billing.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing field `charge_item` in initializer of `<routes::internal::billing::stripe_webhook as actix_web::dev::HttpServiceFactory>::register::stripe_webhook::{closure#0}::PaymentIntentMetadata`

error[E0063]: missing field `charge_item` in initializer of `<routes::internal::billing::stripe_webhook as actix_web::dev::HttpServiceFactory>::register::stripe_webhook::{closure#0}::PaymentIntentMetadata`
   --> src/routes/internal/billing.rs:893:43
    |
893 | ...                   return Ok(PaymentIntentMetadata {
    |                                 ^^^^^^^^^^^^^^^^^^^^^ missing `charge_item`

Check warning on line 72 in src/queue/analytics.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function depends on never type fallback being `()`

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)
    |                  ^^^^^^^^^^^

Check warning on line 507 in src/database/redis.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function depends on never type fallback being `()`

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?;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 493 in src/database/redis.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function depends on never type fallback being `()`

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?;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 427 in src/database/redis.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function depends on never type fallback being `()`

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?;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 147 in src/database/redis.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function depends on never type fallback being `()`

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

Check warning on line 26 in src/routes/internal/billing.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused import: `ListCharges`

warning: unused import: `ListCharges`
  --> src/routes/internal/billing.rs:26:86
   |
26 |     CustomerInvoiceSettings, CustomerPaymentMethodRetrieval, EventObject, EventType, ListCharges,
   |                                                                                      ^^^^^^^^^^^

Check warning on line 7 in src/routes/internal/billing.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused import: `ChargeStatus`

warning: unused import: `ChargeStatus`
 --> src/routes/internal/billing.rs:7:13
  |
7 |     Charge, ChargeStatus, Price, PriceDuration, Product, ProductMetadata, ProductPrice,
  |             ^^^^^^^^^^^^

Check warning on line 3 in src/routes/internal/billing.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused imports: `generate_charge_id` and `generate_user_subscription_id`

warning: unused imports: `generate_charge_id` and `generate_user_subscription_id`
 --> src/routes/internal/billing.rs:3:5
  |
3 |     generate_charge_id, generate_user_subscription_id, product_item, user_subscription_item,
  |     ^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

Check failure on line 1330 in src/routes/internal/billing.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

cannot find value `subscription` in this scope

error[E0425]: cannot find value `subscription` in this scope
    --> src/routes/internal/billing.rs:1330:37
     |
77   | #[get("subscriptions")]
     | ----------------------- similarly named unit struct `subscriptions` defined here
...
1330 |                                     subscription.upsert(&mut transaction).await?;
     |                                     ^^^^^^^^^^^^ help: a unit struct with a similar name exists: `subscriptions`

Check failure on line 1327 in src/routes/internal/billing.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

cannot find value `subscription` in this scope

error[E0425]: cannot find value `subscription` in this scope
    --> src/routes/internal/billing.rs:1327:41
     |
77   | #[get("subscriptions")]
     | ----------------------- similarly named unit struct `subscriptions` defined here
...
1327 |                                         subscription.status = SubscriptionStatus::PaymentFailed;
     |                                         ^^^^^^^^^^^^ help: a unit struct with a similar name exists: `subscriptions`

Check failure on line 1323 in src/routes/internal/billing.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

cannot find value `subscription` in this scope

error[E0425]: cannot find value `subscription` in this scope
    --> src/routes/internal/billing.rs:1323:41
     |
77   | #[get("subscriptions")]
     | ----------------------- similarly named unit struct `subscriptions` defined here
...
1323 |                                         subscription.status = SubscriptionStatus::PaymentProcessing;
     |                                         ^^^^^^^^^^^^ help: a unit struct with a similar name exists: `subscriptions`

Check failure on line 1308 in src/routes/internal/billing.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

cannot find value `subscription` in this scope

error[E0425]: cannot find value `subscription` in this scope
    --> src/routes/internal/billing.rs:1308:41
     |
77   | #[get("subscriptions")]
     | ----------------------- similarly named unit struct `subscriptions` defined here
...
1308 |                                         subscription.interval.as_str().to_string(),
     |                                         ^^^^^^^^^^^^ help: a unit struct with a similar name exists: `subscriptions`

Check failure on line 1304 in src/routes/internal/billing.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

cannot find value `subscription` in this scope

error[E0425]: cannot find value `subscription` in this scope
    --> src/routes/internal/billing.rs:1304:51
     |
77   | #[get("subscriptions")]
     | ----------------------- similarly named unit struct `subscriptions` defined here
...
1304 |                                         to_base62(subscription.id.0 as u64),
     |                                                   ^^^^^^^^^^^^ help: a unit struct with a similar name exists: `subscriptions`

Check failure on line 1255 in src/routes/internal/billing.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

cannot find value `subscription` in this scope

error[E0425]: cannot find value `subscription` in this scope
    --> src/routes/internal/billing.rs:1255:41
     |
77   | #[get("subscriptions")]
     | ----------------------- similarly named unit struct `subscriptions` defined here
...
1255 |                                         subscription.id,
     |                                         ^^^^^^^^^^^^ help: a unit struct with a similar name exists: `subscriptions`

Check failure on line 1228 in src/routes/internal/billing.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

cannot find value `subscription` in this scope

error[E0425]: cannot find value `subscription` in this scope
    --> src/routes/internal/billing.rs:1228:46
     |
77   | #[get("subscriptions")]
     | ----------------------- similarly named unit struct `subscriptions` defined here
...
1228 |                                 let active = subscription.status == SubscriptionStatus::Active;
     |                                              ^^^^^^^^^^^^ help: a unit struct with a similar name exists: `subscriptions`

Check failure on line 1224 in src/routes/internal/billing.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

cannot find value `subscription` in this scope

error[E0425]: cannot find value `subscription` in this scope
    --> src/routes/internal/billing.rs:1224:41
     |
77   | #[get("subscriptions")]
     | ----------------------- similarly named unit struct `subscriptions` defined here
...
1224 |                                         subscription.status == SubscriptionStatus::PaymentFailed
     |                                         ^^^^^^^^^^^^ help: a unit struct with a similar name exists: `subscriptions`

Check failure on line 1221 in src/routes/internal/billing.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

cannot find value `subscription` in this scope

error[E0425]: cannot find value `subscription` in this scope
    --> src/routes/internal/billing.rs:1221:54
     |
77   | #[get("subscriptions")]
     | ----------------------- similarly named unit struct `subscriptions` defined here
...
1221 |                                 let payment_failed = subscription
     |                                                      ^^^^^^^^^^^^ help: a unit struct with a similar name exists: `subscriptions`

Check failure on line 1220 in src/routes/internal/billing.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

cannot find value `subscription` in this scope

error[E0425]: cannot find value `subscription` in this scope
    --> src/routes/internal/billing.rs:1220:37
     |
77   | #[get("subscriptions")]
     | ----------------------- similarly named unit struct `subscriptions` defined here
...
1220 |                                     subscription.status == SubscriptionStatus::Cancelled;
     |                                     ^^^^^^^^^^^^ help: a unit struct with a similar name exists: `subscriptions`

Check failure on line 1214 in src/routes/internal/billing.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

cannot find value `subscription` in this scope

error[E0425]: cannot find value `subscription` in this scope
    --> src/routes/internal/billing.rs:1214:52
     |
77   | #[get("subscriptions")]
     | ----------------------- similarly named unit struct `subscriptions` defined here
...
1214 |                                     intervals.get(&subscription.interval)
     |                                                    ^^^^^^^^^^^^ help: a unit struct with a similar name exists: `subscriptions`

Check failure on line 803 in src/routes/internal/billing.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

cannot find value `price_item` in this scope

error[E0425]: cannot find value `price_item` in this scope
   --> src/routes/internal/billing.rs:803:35
    |
803 |             "price_id": to_base62(price_item.id.0 as u64),
    |                                   ^^^^^^^^^^ help: a local variable with a similar name exists: `price_id`

Check failure on line 758 in src/routes/internal/billing.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

cannot find value `price_item` in this scope

error[E0425]: cannot find value `price_item` in this scope
   --> src/routes/internal/billing.rs:758:35
    |
758 |             "price_id": to_base62(price_item.id.0 as u64),
    |                                   ^^^^^^^^^^ help: a local variable with a similar name exists: `price_id`