Skip to content

fix(lib): satisfy clippy unnecessary_to_owned in the website blob test - #1559

Closed
joepio wants to merge 1 commit into
developfrom
claude/fix-clippy-website-test
Closed

joepio wants to merge 1 commit into
developfrom
claude/fix-clippy-website-test

Conversation

@joepio

@joepio joepio commented Sep 18, 2026

Copy link
Copy Markdown
Member

Related Issues

No linked issue. Found while running the CI clippy command for the data-flow fix series (#1544, #1553, #1557 and follow-ups).

What

lib/src/db/website.rs (test module, line 402) called blake3::hash(..).to_hex().to_string() and then borrowed the result as &str. Stable clippy flags this as unnecessary_to_owned, so

cargo clippy --workspace --exclude atomic-server-tauri --no-deps --all-targets --no-default-features --features light -- -D warnings

fails on develop, and with it the Husky pre-commit hook for every Rust change. This borrows the hex string directly (.to_hex().as_str()).

Testing

  • Without the change, the clippy command above reports unnecessary use of to_string at website.rs:402; with it, Finished with exit 0.
  • cargo test -p atomic_lib --features db-redb --lib -- website: 3 passed.

Checklist

  • Add changelog entry linking to issue, describe API changes (no behavior or API change, test-only lint fix)
  • Add or update tests if needed (not needed)
  • Update docs if needed (not needed)

🤖 Generated with Claude Code

https://claude.ai/code/session_01KxExJcGw13DnHknGTMAhXY


Generated by Claude Code

`blake3::hash(..).to_hex().to_string()` allocated a String only to borrow
it as `&str`. Stable clippy flags this as `unnecessary_to_owned`, which
fails the CI clippy command (`-D warnings`) and therefore the pre-commit
hook for every Rust change on develop. Borrow the hex string directly.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KxExJcGw13DnHknGTMAhXY

joepio commented Sep 19, 2026

Copy link
Copy Markdown
Member Author

Closing: develop already carries this exact fix. #1558 (fix(server,lib): security hygiene from the September 2026 audit, 5403ff4) rewrote lib/src/db/website.rs:402 to db.website_verified_blob(blake3::hash(b"Hello").to_hex().as_str()), so the branch is now byte-identical to develop and the CI clippy command passes there. Nothing left to merge.


Generated by Claude Code

@joepio joepio closed this Sep 19, 2026
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.

2 participants