Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Apply nightly clippy suggestions #5625

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

Merged
merged 1 commit into from
Mar 27, 2025
Merged

Conversation

youknowone
Copy link
Member

No description provided.

@youknowone youknowone requested a review from Copilot March 27, 2025 04:30
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR applies a series of nightly clippy suggestions across multiple modules to improve code clarity and safety.

  • Refactors existing patterns (e.g., using Option::replace, is_empty, saturating_sub, repeat_n, and std::ptr::eq) to be more idiomatic and potentially safer.
  • Simplifies code by removing unnecessary temporary variables and using more expressive standard library functions.

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
vm/src/stdlib/signal.rs Uses Option::replace for more concise signal handler update.
vm/src/stdlib/itertools.rs Refactors is_empty and repeat iterators for clarity.
vm/src/stdlib/ctypes/base.rs Applies std::ptr::eq to compare pointers safely.
vm/src/frame.rs Updates instruction matching to align with expected enum.
vm/src/builtins/tuple.rs Simplifies tuple emptiness check.
vm/src/builtins/staticmethod.rs Removes unnecessary variable assignment.
vm/src/builtins/range.rs Uses saturating_sub for more robust length hint calculation.
vm/src/anystr.rs Adopts repeat_n for clearer iteration over fill characters.
stdlib/src/csv.rs Fixes slices acquisition for clarity and safety.
stdlib/src/binascii.rs Uses div_ceil for a more reliable capacity calculation.
src/settings.rs Improves string emptiness check via is_empty.
compiler/codegen/src/symboltable.rs Uses Option::replace for cleaner class name update.
compiler/codegen/src/ir.rs Streamlines location vector population with repeat_n.
compiler/codegen/src/compile.rs Uses Option::replace to simplify class name assignment.
common/src/str.rs Adopts repeat_n for a clearer zfill implementation.
common/src/boxvec.rs Switches to std::ptr::eq for more explicit pointer comparison.

@coolreader18 coolreader18 merged commit c9161c0 into RustPython:main Mar 27, 2025
11 checks passed
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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.