Skip to content

Optimize user-generated images for reduced bandwidth (#961) #2217

Optimize user-generated images for reduced bandwidth (#961)

Optimize user-generated images for reduced bandwidth (#961) #2217

GitHub Actions / clippy succeeded Sep 8, 2024 in 1s

clippy

11 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 11
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 warning on line 116 in src/routes/v2/version_creation.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

match can be simplified with `.unwrap_or_default()`

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(),
    |

Check warning on line 1400 in src/routes/internal/flows.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
    --> src/routes/internal/flows.rs:1398:15
     |
1398 |           .post(&format!(
     |  _______________^
1399 | |             "https://api.beehiiv.com/v2/publications/{id}/subscriptions"
1400 | |         ))
     | |_________^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
help: change this to
     |
1398 ~         .post(format!(
1399 +             "https://api.beehiiv.com/v2/publications/{id}/subscriptions"
1400 ~         ))
     |

Check warning on line 773 in src/routes/internal/flows.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/routes/internal/flows.rs:771:26
    |
771 |                       .get(&format!(
    |  __________________________^
772 | |                         "{api_url}identity/openidconnect/userinfo?schema=openid"
773 | |                     ))
    | |_____________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
help: change this to
    |
771 ~                     .get(format!(
772 +                         "{api_url}identity/openidconnect/userinfo?schema=openid"
773 ~                     ))
    |

Check warning on line 515 in src/routes/internal/flows.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/routes/internal/flows.rs:515:27
    |
515 |                     .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

Check warning on line 78 in src/queue/payouts.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
  --> src/queue/payouts.rs:78:19
   |
78 |             .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

Check warning on line 21 in src/file_hosting/backblaze/delete.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

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

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