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

Unused variable warning in pagefind_web/src/lib.rs #754

Open
tenax66 opened this issue Dec 13, 2024 · 0 comments
Open

Unused variable warning in pagefind_web/src/lib.rs #754

tenax66 opened this issue Dec 13, 2024 · 0 comments

Comments

@tenax66
Copy link
Contributor

tenax66 commented Dec 13, 2024

Hi,
When building pagefind_web by ./local_build.sh, I encountered warnings about unused variables in the src/lib.rs file.

[INFO]: 🌀  Compiling to Wasm...
   Compiling pagefind_web v0.0.0 (/**/pagefind/pagefind_web)
warning: unused variable: `e`
   --> src/lib.rs:118:13
    |
118 |         Err(e) => {
    |             ^ help: if this is intentional, prefix it with an underscore: `_e`
    |
    = note: `#[warn(unused_variables)]` on by default

warning: unused variable: `e`
   --> src/lib.rs:174:13
    |
174 |         Err(e) => {
    |             ^ help: if this is intentional, prefix it with an underscore: `_e`

warning: unused variable: `e`
   --> src/lib.rs:188:13
    |
188 |         Err(e) => {
    |             ^ help: if this is intentional, prefix it with an underscore: `_e`

The warnings are caused by the usage of e as shown below:

Err(e) => {
    debug!({ format!("{:#?}", e) });
    std::ptr::null_mut::<SearchIndex>()
}

Avoiding warnings while keeping this implementation simple may be a little difficult. It may be acceptable to add #[allow(unused_variables)] to suppress warnings.
I can create a PR to address the issue. Thank you

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

1 participant