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

Build warnings #1141

Open
qtfkwk opened this issue Aug 20, 2024 · 7 comments
Open

Build warnings #1141

qtfkwk opened this issue Aug 20, 2024 · 7 comments

Comments

@qtfkwk
Copy link
Contributor

qtfkwk commented Aug 20, 2024

warning: method `is_not_line_ending_whitespace` is never used
 --> src/utils/ext.rs:5:8
  |
3 | pub(crate) trait AsciiExt {
  |                  -------- method in this trait
4 |     fn is_whitespace(&self) -> bool;
5 |     fn is_not_line_ending_whitespace(&self) -> bool;
  |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: constant `FALLBACK_ROW_LEN` is never used
 --> src/consts.rs:3:11
  |
3 | pub const FALLBACK_ROW_LEN: usize = 81;
  |           ^^^^^^^^^^^^^^^^

warning: constant `LANGUAGE_COLUMN_WIDTH` is never used
 --> src/consts.rs:6:11
  |
6 | pub const LANGUAGE_COLUMN_WIDTH: usize = 10;
  |           ^^^^^^^^^^^^^^^^^^^^^

warning: constant `PATH_COLUMN_WIDTH` is never used
 --> src/consts.rs:7:11
  |
7 | pub const PATH_COLUMN_WIDTH: usize = 80;
  |           ^^^^^^^^^^^^^^^^^

warning: constant `FILES_COLUMN_WIDTH` is never used
 --> src/consts.rs:8:11
  |
8 | pub const FILES_COLUMN_WIDTH: usize = 8;
  |           ^^^^^^^^^^^^^^^^^^

warning: `tokei` (lib) generated 5 warnings
warning: field `verbose` is never read
  --> src/cli.rs:55:9
   |
38 | pub struct Cli {
   |            --- field in this struct
...
55 |     pub verbose: u64,
   |         ^^^^^^^
   |
   = note: `Cli` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
   = note: `#[warn(dead_code)]` on by default

warning: associated function `all` is never used
   --> src/cli_utils.rs:114:12
    |
104 | impl NumberFormatStyle {
    | ---------------------- associated function in this implementation
...
114 |     pub fn all() -> &'static [&'static str] {
    |            ^^^

warning: `tokei` (bin "tokei") generated 2 warnings

Originally posted by @0323pin in #1138 (comment)

qtfkwk pushed a commit to qtfkwk/tokei that referenced this issue Aug 20, 2024
@qtfkwk
Copy link
Contributor Author

qtfkwk commented Aug 20, 2024

Summary of fixes:

  • Added empty json feature and included in all
  • Removed unnecessary Cli.verbose property
  • Removed unnecessary NumberFormatStyle.all() method
  • Added doc strings for pub constants in src/consts.rs
  • Exported self::consts::* in src/lib.rs
  • Removed unused AsciiExt.is_not_line_ending_whitespace() method

@qtfkwk
Copy link
Contributor Author

qtfkwk commented Aug 20, 2024

PR: #1142

@qtfkwk
Copy link
Contributor Author

qtfkwk commented Aug 20, 2024

  • Added empty json feature and included in all

Had to roll back the first item due to that fix causing build issues in checks.

AFAICT prior recent releases v13.0.0-alpha{1,2} also produced these warnings so it is not related to #1137, #1138, or subsequent PRs.

Unsure if/how @XAMPPRocky et al want to address those?

@qtfkwk
Copy link
Contributor Author

qtfkwk commented Aug 21, 2024

Just realized @0323pin's build warnings do not include the following, which is also observed, and my reason for trying to add a json feature.

Pending release of v13.0.0-alpha.4, this issue can be closed, and this build warning (really there are 9 of these, but this is the first one) can be addressed in a new issue.

warning: unexpected `cfg` condition value: `json`
   --> src/input.rs:24:23
    |
24  |                   #[cfg(feature = $feature)] extern crate $krate;
    |                         ^^^^^^^^^^^^^^^^^^
...
149 | / supported_formats!(
150 | |     (cbor, "cbor", Cbor [serde_cbor, hex]) =>
151 | |         |input| {
152 | |             hex::FromHex::from_hex(input)
...   |
164 | |         serde_yaml::to_string,
165 | | );
    | |_- in this macro invocation
    |
    = note: expected values for `feature` are: `all`, `cbor`, `default`, `hex`, `serde_cbor`, `serde_yaml`, and `yaml`
    = help: consider adding `json` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
    = note: `#[warn(unexpected_cfgs)]` on by default
    = note: this warning originates in the macro `supported_formats` (in Nightly builds, run with -Z macro-backtrace for more info)

@0323pin
Copy link

0323pin commented Aug 23, 2024

I think this can be closed now. Built alpha5 a few hours ago without any of these.

Actually, merged the update into the main branch

Just curious ... when should we expect a "real" release?

@XAMPPRocky
Copy link
Owner

XAMPPRocky commented Aug 24, 2024

Just curious ... when should we expect a "real" release?

When I've decided it is ready, I'd kindly remind you that this is a project maintained by me in my spare time, on top of a job and other projects as well having a life outside of programming. Unless I'm paid directly to maintain and regularly release new versions, don't "expect" a release, it will arrive when it means to.

@0323pin
Copy link

0323pin commented Aug 24, 2024

@XAMPPRocky I didn't mean it like that. Believe me, I'm maintaining a large number of packages for NetBSD (among which, this one) on my free time so, I know the feeling.

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

No branches or pull requests

3 participants