Skip to content

Fix warnings

Fix warnings #7

Triggered via pull request August 6, 2024 11:02
Status Cancelled
Total duration 30m 32s
Artifacts 10

pull_request.yml

on: pull_request
build  /  Build axolotl-web
36s
build / Build axolotl-web
Matrix: build / Flatpak
Matrix: build / package-click
Fit to window
Zoom out
Zoom in

Annotations

2 errors and 16 warnings
build / Flatpak (aarch64, ARM64)
Canceling since a higher priority waiting request for 'Axolotl pull request pipeline-refs/pull/1293/merge' exists
build / Flatpak (aarch64, ARM64)
The operation was canceled.
test / clippy
clippy-action doesn't have permissions to create Check Runs, disabling!
test / clippy
Resource not accessible by integration - https://docs.github.com/rest/checks/runs#create-a-check-run
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/lib.rs#L1326
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/handlers.rs:1326:17 | 1326 | / match thread { 1327 | | Thread::Contact(uuid) => { 1328 | | let contact = match manager.get_contact_by_id(uuid).await.unwrap() { 1329 | | Some(c) => c, ... | 1345 | | _ => (), 1346 | | } | |_________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match = note: `#[warn(clippy::single_match)]` on by default help: try | 1326 ~ if let Thread::Contact(uuid) = thread { 1327 + let contact = match manager.get_contact_by_id(uuid).await.unwrap() { 1328 + Some(c) => c, 1329 + None => { 1330 + log::error!("handle_get_message_list: Contact not found"); 1331 + return Err(ApplicationError::InvalidRequest); 1332 + } 1333 + }; 1334 + match self.update_contact_name(contact).await { 1335 + Ok(_) => (), 1336 + Err(e) => { 1337 + log::error!( 1338 + "handle_get_message_list: Error updating contact name: {}", 1339 + e 1340 + ); 1341 + } 1342 + } 1343 + } |
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/lib.rs#L1352
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/handlers.rs:1352:25 | 1352 | / match thread { 1353 | | Thread::Contact(uuid) => { 1354 | | if Uuid::parse_str(&title).is_ok() || title.is_empty() { 1355 | | let contact = ... | 1386 | | _ => (), 1387 | | } | |_________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match help: try | 1352 ~ if let Thread::Contact(uuid) = thread { 1353 + if Uuid::parse_str(&title).is_ok() || title.is_empty() { 1354 + let contact = 1355 + match manager.get_contact_by_id(uuid).await.unwrap() { 1356 + Some(c) => c, 1357 + None => { 1358 + log::error!( 1359 + "handle_get_message_list: Contact not found" 1360 + ); 1361 + return Err(ApplicationError::InvalidRequest); 1362 + } 1363 + }; 1364 + _ = match self.update_contact_name(contact).await { 1365 + Ok(c) => c.unwrap(), 1366 + Err(e) => { 1367 + log::error!("Error updating contact name: {}", e); 1368 + return Err(ApplicationError::InvalidRequest); 1369 + } 1370 + }; 1371 + 1372 + // retrieve updated thread metadata 1373 + thread_metadata = 1374 + match manager.thread_metadata(&thread).await.unwrap() { 1375 + Some(tm) => tm, 1376 + None => { 1377 + log::error!( 1378 + "handle_get_message_list: Thread metadata not found" 1379 + ); 1380 + return Err(ApplicationError::InvalidRequest); 1381 + } 1382 + }; 1383 + } 1384 + } |
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/lib.rs#L1597
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/handlers.rs:1597:9 | 1597 | / match response_data.thread { 1598 | | Thread::Contact(uuid) => { 1599 | | if response_data.title.is_none() || response_data.title.clone().unwrap().len() == 36 1600 | | { ... | 1622 | | _ => {} 1623 | | } | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match help: try | 1597 ~ if let Thread::Contact(uuid) = response_data.thread { 1598 + if response_data.title.is_none() || response_data.title.clone().unwrap().len() == 36 1599 + { 1600 + log::debug!("Updating contact from profile {:?}", uuid); 1601 + let contact = match manager.get_contact_by_id(uuid).await.unwrap() { 1602 + Some(c) => c, 1603 + None => { 1604 + log::error!("No contact found"); 1605 + return Err(ApplicationError::RegistrationError( 1606 + "No contact found".to_string(), 1607 + )); 1608 + } 1609 + }; 1610 + match self.update_contact_name(contact).await { 1611 + Ok(_) => { 1612 + response_data = 1613 + manager.thread_metadata(&thread).await.unwrap().unwrap(); 1614 + } 1615 + Err(e) => { 1616 + log::error!("Error updating contact name: {}", e); 1617 + } 1618 + } 1619 + } 1620 + } |
this function has too many arguments (8/7): src/lib.rs#L160
warning: this function has too many arguments (8/7) --> src/manager_thread.rs:160:5 | 160 | / pub async fn new( 161 | | config_store: presage_store_sled::SledStore, 162 | | device_name: String, 163 | | link_callback: futures::channel::oneshot::Sender<url::Url>, ... | 168 | | uuid: Uuid, 169 | | ) -> Option<Self> { | |_____________________^ | = 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
4 warnings emitted
warning: 4 warnings emitted
test / Test axolotl-web: axolotl-web/src/components/Message.vue#L134
'v-html' directive can lead to XSS attack
build / Package as click amd64
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/github-script@v4. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
build / Package as click amd64
The following actions uses Node.js version which is deprecated and will be forced to run on node20: actions/github-script@v4. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
build / Package as click arm64
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/github-script@v4. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
build / Package as click arm64
The following actions uses Node.js version which is deprecated and will be forced to run on node20: actions/github-script@v4. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
build / Package as click armhf
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/github-script@v4. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
build / Package as click armhf
The following actions uses Node.js version which is deprecated and will be forced to run on node20: actions/github-script@v4. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
build / Build axolotl
New version for tauri-cli available: 2.0.0-rc.1
build / Build axolotl arm64
New version for tauri-cli available: 2.0.0-rc.1

Artifacts

Produced during runtime
Name Size
axolotl-web Expired
709 KB
axolotl-x86_64.flatpak
6.83 MB
build-axolotl-linux-amd64 Expired
11 MB
build-axolotl-linux-amd64-appimage Expired
96 MB
build-axolotl-linux-amd64-click Expired
7.78 MB
build-axolotl-linux-amd64-deb Expired
10.7 MB
build-axolotl-linux-arm64 Expired
11.1 MB
build-axolotl-linux-arm64-click Expired
7.76 MB
build-axolotl-linux-arm64-deb Expired
10.7 MB
build-axolotl-linux-armhf-click Expired
7.48 MB