Skip to content

Conversation

@PtPrashantTripathi
Copy link
Member

Summary

This PR focuses on addressing all Rust-side issues flagged by Clippy and compiler warnings, along with essential dependency upgrades to maintain compatibility with the latest stable Rust (1.88+). These changes are required for code health, stability, and long-term maintainability.

Key Changes

Clippy Fixes

Resolved Clippy warnings with cargo clippy --all-targets --all-features -- -D warnings including:

  • Replaced legacy numeric constants:

    • std::u8::MAXu8::MAX
    • Removed outdated imports like use std::u8::MAX;
  • Fixed uninlined format arguments:

    • Rewrote format! and println! calls using named arguments like:

      println!("{name}")  // instead of println("{}", name)
  • Updated unsafe pointer comparison:

    • Replaced ptr as *const T != end with !std::ptr::eq(ptr, end)

Dependency Upgrades

  • wasm-bindgen: 0.2.840.2.100
  • syn: 1.0.x2.0.12
  • rustversion: added (1.0.21) to support newer wasm-bindgen
  • Updated Cargo.lock to reflect these changes

These upgrades are required due to breaking changes in recent Rust releases, where older versions of wasm-bindgen were incompatible with Rust 1.88+.

Code Enhancements

  • Added impl Default for Aadhaar for ergonomic default construction
  • Ensured lifetime annotations in Result<Sourcecode> were properly corrected:
    Result<'sc>Result<Sourcecode<'sc>>

How to Test

  1. Run cargo build --release → ✅ should build cleanly
  2. Run cargo clippy --all-targets --all-features -- -D warnings → ✅ zero warnings
  3. Run tests: cargo test --all

Notes

  • This PR builds on top of the pre-commit, CLI, and formatting enhancements from the prior PR.
  • The project now supports latest Rust toolchain cleanly with no deprecated usage.

- Fixed broken Python syntax in `benchmark_test.py`
- Refactored `cli.py`:
  - Corrected typos and naming issues (e.g., `ENV_VARBOSE` → `ENV_VERBOSE`)
  - Improved command-line argument parsing consistency
  - Added support for running `pre-commit` after formatting
  - Enhanced user messages and command output
  - Ensured tool checks for cargo, wasm-pack, and pre-commit
@PtPrashantTripathi PtPrashantTripathi linked an issue Jul 4, 2025 that may be closed by this pull request
1 task
@PtPrashantTripathi
Copy link
Member Author

Hey @Takshil-Kunadia 👋 — before I deploy, just checking if you'd like to do any final testing.

I noticed a \u200B (zero-width space) that might’ve been unintentionally left from when I was coding on Windows — I’ve removed it now. Also included a few other cleanup changes on top of your last patch.

Let me know if you want to take a quick look or run any additional tests before I ship it 🚀

@PtPrashantTripathi PtPrashantTripathi merged commit 918a9ba into main Jul 4, 2025
4 of 5 checks passed
@PtPrashantTripathi PtPrashantTripathi deleted the 36-fix-code-scanning-alert---usage-of-a-legacy-numeric-constant branch July 4, 2025 16:26
@Takshil-Kunadia
Copy link

Had a look anyways, LGTM ✅ 🚀

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.

Fix code scanning alert - usage of a legacy numeric constant

3 participants