Skip to content

Reapply 1501 dependabot/cargo/rand 0.9.0 (#1535)#2365

Open
ChanTsune wants to merge 1 commit into
mainfrom
reapply-dependabot/cargo/rand-0.9.0
Open

Reapply 1501 dependabot/cargo/rand 0.9.0 (#1535)#2365
ChanTsune wants to merge 1 commit into
mainfrom
reapply-dependabot/cargo/rand-0.9.0

Conversation

@ChanTsune

Copy link
Copy Markdown
Owner

No description provided.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @ChanTsune, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request re-applies a previous Dependabot update, focusing on upgrading the rand crate and its ecosystem dependencies to their 0.9.x versions. The changes involve adapting the codebase to the updated API, particularly by introducing fallible random number generation and salt creation, and configuring getrandom for WebAssembly targets. This ensures the project leverages the latest improvements and security fixes in these critical randomness-related crates while maintaining compatibility across different build targets.

Highlights

  • Dependency Upgrade: The rand crate and its associated dependencies (rand_chacha, rand_core, getrandom) have been upgraded to their 0.9.x versions, bringing the project up to date with the latest randomness-related libraries.
  • Improved Randomness Error Handling: Random number generation and salt string creation functions now return io::Result, enabling robust error handling in scenarios where the underlying random number generator might fail to initialize or provide entropy.
  • WASM Compatibility: A rustflags configuration has been added to .cargo/config.toml to explicitly set the getrandom_backend for wasm32-unknown-unknown targets, ensuring proper functionality of getrandom in WebAssembly environments.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the rand crate to version 0.9.0 and applies the necessary code changes for this update. The changes are mostly correct and handle the new fallible APIs of the rand crate. The change from usize to u64 for random number generation for filenames is a good improvement for cross-platform consistency. I've found one area for improvement in lib/src/random.rs where the code can be simplified and made more efficient by using rand::rngs::OsRng directly instead of creating a new ChaCha20Rng on each call. Overall, this is a good update that correctly migrates to the new rand version.

Comment thread lib/src/random.rs
@github-actions github-actions Bot added dependencies Pull requests that update a dependency file cli This issue is about cli application lib This issue is about lib crate labels Nov 21, 2025
@ChanTsune
ChanTsune force-pushed the reapply-dependabot/cargo/rand-0.9.0 branch from 6e9fffd to bc6f12b Compare November 22, 2025 01:51
@ChanTsune
ChanTsune force-pushed the reapply-dependabot/cargo/rand-0.9.0 branch from bc6f12b to b07c9b3 Compare November 22, 2025 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli This issue is about cli application dependencies Pull requests that update a dependency file lib This issue is about lib crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant