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

Fix broken Rust test suite and clippy warnings. #392

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

runfalk
Copy link
Contributor

@runfalk runfalk commented Jul 15, 2023

Addresses the following errors:

Cargo test

$ cargo test
   Compiling bupstash v0.12.1 (/home/ante/dev/bupstash)
error[E0599]: no method named `metadata` found for struct `fstx2::ReadTxn` in the current scope
   --> src/fstx2.rs:802:21
    |
307 | pub struct ReadTxn<'a> {
    | ---------------------- method `metadata` not found for this struct
...
802 |         assert!(txn.metadata("renamed").is_ok());
    |                     ^^^^^^^^ method not found in `ReadTxn<'_>`
    |
help: some of the expressions' fields have a method of the same name
    |
802 |         assert!(txn._lock.metadata("renamed").is_ok());
    |                     ++++++
802 |         assert!(txn.fs.metadata("renamed").is_ok());
    |                     +++

error[E0599]: no method named `metadata` found for struct `fstx2::ReadTxn` in the current scope
   --> src/fstx2.rs:803:21
    |
307 | pub struct ReadTxn<'a> {
    | ---------------------- method `metadata` not found for this struct
...
803 |         assert!(txn.metadata("some_dir").is_ok());
    |                     ^^^^^^^^ method not found in `ReadTxn<'_>`
    |
help: some of the expressions' fields have a method of the same name
    |
803 |         assert!(txn._lock.metadata("some_dir").is_ok());
    |                     ++++++
803 |         assert!(txn.fs.metadata("some_dir").is_ok());
    |                     +++

For more information about this error, try `rustc --explain E0599`.
error: could not compile `bupstash` (bin "bupstash" test) due to 2 previous errors

Clippy

$ cargo clippy
    Checking bupstash v0.12.1 (/home/ante/dev/bupstash)
warning: manual check for common ascii range
  --> src/query.rs:58:5
   |
58 |     ('a'..='z').contains(&c)
   |     ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `c.is_ascii_lowercase()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_ascii_check
   = note: `#[warn(clippy::manual_is_ascii_check)]` on by default

warning: manual check for common ascii range
  --> src/query.rs:59:12
   |
59 |         || ('A'..='Z').contains(&c)
   |            ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `c.is_ascii_uppercase()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_ascii_check

warning: manual check for common ascii range
  --> src/query.rs:60:12
   |
60 |         || ('0'..='9').contains(&c)
   |            ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `c.is_ascii_digit()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_ascii_check

warning: `bupstash` (bin "bupstash") generated 3 warnings (run `cargo clippy --fix --bin "bupstash"` to apply 3 suggestions)
    Finished dev [unoptimized + debuginfo] target(s) in 3.03s

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.

1 participant