Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

cargo sqlx prepare #507

cargo sqlx prepare

cargo sqlx prepare #507

Triggered via push October 27, 2023 18:43
Status Success
Total duration 28s
Artifacts

security.yml

on: push
security_audit
17s
security_audit
Fit to window
Zoom out
Zoom in

Annotations

19 warnings
security_audit
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/audit-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
security_audit
1 warnings found!
security_audit
Unknown warning kind unsound found, please, file a bug
this expression creates a reference which is immediately dereferenced by the compiler: src/routes/v3/users.rs#L194
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/routes/v3/users.rs:194:67 | 194 | filter_authorized_projects(projects, Some(&current_user), &pool).await?; | ^^^^^ help: change this to: `pool` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: src/routes/v3/users.rs#L194
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/routes/v3/users.rs:194:51 | 194 | filter_authorized_projects(projects, Some(&current_user), &pool).await?; | ^^^^^^^^^^^^^ help: change this to: `current_user` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: src/routes/v3/users.rs#L192
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/routes/v3/users.rs:192:77 | 192 | let projects = db_models::Project::get_many_ids(&project_ids, &***pool, &redis).await?; | ^^^^^^ help: change this to: `redis` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `#[warn(clippy::needless_borrow)]` on by default
using `clone` on type `ProjectId` which implements the `Copy` trait: src/routes/v3/users.rs#L189
warning: using `clone` on type `ProjectId` which implements the `Copy` trait --> src/routes/v3/users.rs:189:23 | 189 | } => Some(project_id.clone()), | ^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*project_id` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
this `.filter_map` can be written more simply using `.map`: src/routes/v3/users.rs#L183
warning: this `.filter_map` can be written more simply using `.map` --> src/routes/v3/users.rs:183:23 | 183 | let project_ids = events | _______________________^ 184 | | .iter() 185 | | .filter_map(|e| match &e.event_data { 186 | | EventData::ProjectCreated { ... | 189 | | } => Some(project_id.clone()), 190 | | }) | |__________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_filter_map = note: `#[warn(clippy::unnecessary_filter_map)]` on by default
this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`: src/routes/v3/oauth_clients.rs#L438
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` --> src/routes/v3/oauth_clients.rs:438:39 | 438 | let ids: Vec<OAuthClientId> = ids.into_iter().map(|i| (*i).into()).collect(); | ^^^^^^^^^ help: call directly: `iter` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
this function has too many arguments (8/7): src/routes/v3/follow.rs#L74
warning: this function has too many arguments (8/7) --> src/routes/v3/follow.rs:74:1 | 74 | / pub async fn unfollow<T, TId, Fut1, Fut2>( 75 | | req: HttpRequest, 76 | | target_id: web::Path<String>, 77 | | pool: web::Data<PgPool>, ... | 82 | | error_word: &str, 83 | | ) -> Result<HttpResponse, ApiError> | |___________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
this function has too many arguments (8/7): src/routes/v3/follow.rs#L29
warning: this function has too many arguments (8/7) --> src/routes/v3/follow.rs:29:1 | 29 | / pub async fn follow<T, TId, Fut1, Fut2>( 30 | | req: HttpRequest, 31 | | target_id: web::Path<String>, 32 | | pool: web::Data<PgPool>, ... | 37 | | error_word: &str, 38 | | ) -> Result<HttpResponse, ApiError> | |___________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments = note: `#[warn(clippy::too_many_arguments)]` on by default
redundant closure: src/routes/v2/project_creation.rs#L908
warning: redundant closure --> src/routes/v2/project_creation.rs:908:17 | 908 | |org| CreatorId::Organization(org), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `CreatorId::Organization` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
useless conversion to the same type: `models::organizations::OrganizationId`: src/routes/v2/project_creation.rs#L851
warning: useless conversion to the same type: `models::organizations::OrganizationId` --> src/routes/v2/project_creation.rs:851:71 | 851 | organization: project_create_data.organization_id.map(|x| x.into()), | ^^^^^^^^ help: consider removing `.into()`: `x` | = 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
this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`: src/database/models/oauth_client_item.rs#L83
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` --> src/database/models/oauth_client_item.rs:83:23 | 83 | let ids = ids.into_iter().map(|id| id.0).collect_vec(); | ^^^^^^^^^ help: call directly: `iter` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`: src/database/models/event_item.rs#L282
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` --> src/database/models/event_item.rs:282:10 | 282 | .into_iter() | ^^^^^^^^^ help: call directly: `iter` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref = note: `#[warn(clippy::into_iter_on_ref)]` on by default
question mark operator is useless here: src/database/models/event_item.rs#L179
warning: question mark operator is useless here --> src/database/models/event_item.rs:179:9 | 179 | / Ok(sqlx::query_as!( 180 | | RawEvent, 181 | | r#" 182 | | SELECT ... | 210 | | .map(|r| r.try_into()) 211 | | .collect::<Result<Vec<_>, _>>()?) | |_________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark = note: `#[warn(clippy::needless_question_mark)]` on by default help: try removing question mark and `Ok()` | 179 ~ sqlx::query_as!( 180 + RawEvent, 181 + r#" 182 + SELECT 183 + id, 184 + target_id, 185 + target_id_type as "target_id_type: _", 186 + triggerer_id, 187 + triggerer_id_type as "triggerer_id_type: _", 188 + event_type as "event_type: _", 189 + metadata, 190 + created 191 + FROM events e 192 + WHERE 193 + (target_id, target_id_type, event_type) 194 + = ANY(SELECT * FROM UNNEST ($1::bigint[], $2::text[], $3::text[])) 195 + OR 196 + (triggerer_id, triggerer_id_type, event_type) 197 + = ANY(SELECT * FROM UNNEST ($4::bigint[], $5::text[], $6::text[])) 198 + ORDER BY created DESC 199 + "#, 200 + &target_ids[..], 201 + &target_id_types[..] as &[IdType], 202 + &target_event_types[..] as &[EventType], 203 + &triggerer_ids[..], 204 + &triggerer_id_types[..] as &[IdType], 205 + &triggerer_event_types[..] as &[EventType] 206 + ) 207 + .fetch_all(exec) 208 + .await? 209 + .into_iter() 210 + .map(|r| r.try_into()) 211 + .collect::<Result<Vec<_>, _>>() |
redundant closure: src/database/models/event_item.rs#L144
warning: redundant closure --> src/database/models/event_item.rs:144:21 | 144 | |c| Ok(c), | ^^^^^^^^^ help: replace the closure with the function itself: `Ok` | = 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
using `clone` on type `Option<&User>` which implements the `Copy` trait: src/auth/checks.rs#L26
warning: using `clone` on type `Option<&User>` which implements the `Copy` trait --> src/auth/checks.rs:26:44 | 26 | .map(|c| c.validate_authorized(user_option.clone())) | ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `user_option` | = 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
`.map().collect()` can be replaced with `.try_for_each()`: src/auth/checks.rs#L25
warning: `.map().collect()` can be replaced with `.try_for_each()` --> src/auth/checks.rs:25:9 | 25 | / self.into_iter() 26 | | .map(|c| c.validate_authorized(user_option.clone())) 27 | | .collect() | |______________________^ help: try: `self.into_iter().try_for_each(|c| c.validate_authorized(user_option.clone()))` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_collect_result_unit = note: `#[warn(clippy::map_collect_result_unit)]` on by default