Skip to content

fix(clippy): code style — From/Into, derives, naming, borrows, casts#16

Merged
tmthecoder merged 6 commits into
mainfrom
fix/clippy-2-code-style
Apr 4, 2026
Merged

fix(clippy): code style — From/Into, derives, naming, borrows, casts#16
tmthecoder merged 6 commits into
mainfrom
fix/clippy-2-code-style

Conversation

@tejas-claude-bot
Copy link
Copy Markdown
Contributor

Summary

  • Convert impl Into<u64> to impl From<...> for u64
  • Derive Default for SMBShareType, add Default impls for SMBErrorResponse and SMBIPCShare
  • Rename IPC() to ipc() for snake_case convention
  • Remove unnecessary borrows, derefs, and same-type casts
  • Remove unneeded return statements
  • Use iterator instead of index loop in des.rs
  • Use Entry API instead of contains_key + insert

Part 2 of 3 — stacked on PR 1.

Test plan

  • cargo test --lib --features server — 53 tests pass

🤖 Generated with Claude Code

@tmthecoder tmthecoder force-pushed the fix/clippy-2-code-style branch from 0af9acf to f3368f9 Compare April 4, 2026 21:15
Base automatically changed from fix/clippy-1-unused-and-dead-code to main April 4, 2026 21:17
Comment thread smb/src/server/open.rs
Comment thread smb/src/server/mod.rs Outdated
Comment thread smb/src/server/mod.rs Outdated
Comment thread smb/src/server/mod.rs Outdated
Comment thread smb/src/socket/message_stream/mod.rs Outdated
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix this one too

tejas-claude-bot Bot and others added 3 commits April 4, 2026 17:28
- Convert impl Into<u64> to impl From for u64 (command_code.rs)
- Derive Default for SMBShareType, add Default impls for
  SMBErrorResponse and SMBIPCShare
- Rename IPC() to ipc() for snake_case convention
- Remove unnecessary borrows, derefs, and same-type casts
- Remove unneeded return statements
- Use iterator instead of index loop in des.rs
- Use Entry API instead of contains_key+insert in server open table

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove leftover #[allow(dead_code)] on SMBServer
- Replace #[allow(clippy::type_complexity)] with type aliases
- Use `Entry` import instead of fully-qualified path
- Restore FileAttributes TODO struct removed in error

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ype alias

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tmthecoder tmthecoder force-pushed the fix/clippy-2-code-style branch from 1beb159 to 34bd241 Compare April 4, 2026 21:28
tejas-claude-bot Bot and others added 3 commits April 4, 2026 17:37
Define LockedSMBOpen, LockedSMBSession, and SMBLeaseTableOf in their
own files (open.rs, session.rs, lease.rs) instead of mod.rs. This keeps
type aliases co-located with the types they wrap.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tmthecoder tmthecoder merged commit 90e5216 into main Apr 4, 2026
4 of 5 checks passed
@tmthecoder tmthecoder deleted the fix/clippy-2-code-style branch April 4, 2026 21:48
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