DevYukine / red_oxide

A CLI helping with uploading to Redacted, inspired by REDBetter
MIT License
102 stars 18 forks source link

refactor: address `cargo check` warnings and apply `cargo fmt` #26

Open RogueOneEcho opened 1 month ago

RogueOneEcho commented 1 month ago

Quick PR with minor refactors to address cargo warnings and formatting

Before:

$ cargo check
warning: unused variable: `total_tracks`
  --> src/tags/util.rs:62:24
   |
62 |     let (track_number, total_tracks) = tag.track();
   |                        ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_total_tracks`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: constant `WINDOWS_USERPROFILE_ENV` is never used
  --> src/config/constants.rs:11:11
   |
11 | pub const WINDOWS_USERPROFILE_ENV: &str = "USERPROFILE";
   |           ^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: constant `WINDOWS_HOMEDRIVE_ENV` is never used
  --> src/config/constants.rs:12:11
   |
12 | pub const WINDOWS_HOMEDRIVE_ENV: &str = "HOMEDRIVE";
   |           ^^^^^^^^^^^^^^^^^^^^^

warning: constant `WINDOWS_HOMEPATH_ENV` is never used
  --> src/config/constants.rs:13:11
   |
13 | pub const WINDOWS_HOMEPATH_ENV: &str = "HOMEPATH";
   |           ^^^^^^^^^^^^^^^^^^^^

warning: function `count_files_with_extension` is never used
  --> src/fs/util.rs:32:14
   |
32 | pub async fn count_files_with_extension(
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: method `get_torrent_info` is never used
  --> src/redacted/api/client.rs:52:18
   |
26 | impl RedactedApi {
   | ---------------- method in this implementation
...
52 |     pub async fn get_torrent_info(
   |                  ^^^^^^^^^^^^^^^^

warning: `red_oxide` (bin "red_oxide") generated 6 warnings
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.07s

After:

$ cargo check
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.07s