Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor packages: clean announce and scrape handlers #1339

Conversation

josecelano
Copy link
Member

@josecelano josecelano commented Mar 3, 2025

Clean announce and scrape handlers:

  • Extract methods.
  • Rearrange code.
  • Etc.

```output
error: unnecessary `Debug` formatting in `format!` args
   --> console/tracker-client/src/console/clients/checker/app.rs:117:103
    |
117 |     let file_content = std::fs::read_to_string(path).with_context(|| format!("can't read config file {path:?}"))?;
    |                                                                                                       ^^^^
    |
    = help: use `Display` formatting and change this to `path.display()`
    = note: switching to `Display` formatting will change how the value is shown; escaped characters will no longer be escaped and surrounding quotes will be removed
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_debug_formatting
    = note: `-D clippy::unnecessary-debug-formatting` implied by `-D clippy::pedantic`
    = help: to override `-D clippy::pedantic` add `#[allow(clippy::unnecessary_debug_formatting)]`

    Checking torrust-axum-http-tracker-server v3.0.0-develop (/home/josecelano/Documents/git/committer/me/github/torrust/torrust-tracker/packages/axum-http-tracker-server)
error: could not compile `torrust-tracker-client` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `torrust-tracker-client` (lib test) due to 1 previous error
```
@josecelano josecelano self-assigned this Mar 3, 2025
@josecelano josecelano requested a review from da2ce7 March 3, 2025 11:19
@josecelano josecelano linked an issue Mar 3, 2025 that may be closed by this pull request
Copy link

codecov bot commented Mar 3, 2025

Codecov Report

Attention: Patch coverage is 80.39216% with 50 lines in your changes missing coverage. Please review.

Project coverage is 81.62%. Comparing base (d918e47) to head (f9a7bfd).
Report is 12 commits behind head on develop.

Files with missing lines Patch % Lines
packages/http-tracker-core/src/services/scrape.rs 84.55% 18 Missing and 1 partial ⚠️
packages/udp-tracker-core/src/services/scrape.rs 62.85% 11 Missing and 2 partials ⚠️
...ackages/http-tracker-core/src/services/announce.rs 81.03% 11 Missing ⚠️
packages/udp-tracker-core/src/services/announce.rs 84.21% 5 Missing and 1 partial ⚠️
.../tracker-client/src/console/clients/checker/app.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1339      +/-   ##
===========================================
+ Coverage    81.51%   81.62%   +0.10%     
===========================================
  Files          230      230              
  Lines        16275    16366      +91     
  Branches     16275    16366      +91     
===========================================
+ Hits         13267    13358      +91     
  Misses        2770     2770              
  Partials       238      238              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@josecelano josecelano marked this pull request as ready for review March 3, 2025 13:18
@josecelano
Copy link
Member Author

ACK f9a7bfd

@josecelano josecelano merged commit 4d9787d into torrust:develop Mar 3, 2025
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor packages: clean announce and scrape handlers
1 participant