Skip to content

Upgrade to SNAFU 0.9#41

Open
shepmaster wants to merge 1 commit intoredforks:developfrom
shepmaster:snafu-0.9
Open

Upgrade to SNAFU 0.9#41
shepmaster wants to merge 1 commit intoredforks:developfrom
shepmaster:snafu-0.9

Conversation

@shepmaster
Copy link
Copy Markdown

Thanks for using SNAFU! I've just released version 0.9 and my tests caught that your crate would be affected by some of the SemVer-incompatible changes in this version. See the CHANGELOG for a full list.

This commit tries to make the minimal amount of changes to get your code compiling again, but it's entirely possible that there are better solutions for your specific case.

This version also updates the minimum supported Rust version to Rust 1.65 and targets Rust 1.81 by default. I didn't check how these changes affect might your crate, so please make sure to use your judgment as well!

Please feel free to take this PR in whatever form is useful to you; I'm not interested in becoming a long-term contributor to your project, so I'd prefer to not learn your project-specific rules or sign anything like a CLA. I don't mind someone with project approval yoinking these changes and committing it themselves and side-stepping all the red tape.

Thanks for using SNAFU! I've just released version 0.9 and my tests
caught that your crate would be affected by some of the
SemVer-incompatible changes in this version. See the [CHANGELOG][] for
a full list.

This commit tries to make the minimal amount of changes to get your
code compiling again, but it's entirely possible that there are better
solutions for your specific case.

This version also updates the minimum supported Rust version to Rust
1.65 and targets Rust 1.81 by default. I didn't check how these
changes affect might your crate, so please make sure to use your
judgment as well!

Please feel free to take this PR in whatever form is useful to you;
I'm not interested in becoming a long-term contributor to your
project, so I'd prefer to not learn your project-specific rules or
sign anything like a CLA. I don't mind someone with project approval
yoinking these changes and committing it themselves and side-stepping
all the red tape.

[CHANGELOG]: https://github.com/shepmaster/snafu/blob/main/CHANGELOG.md#090---2026-03-02
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, 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 focuses on updating the project's dependency on the snafu error handling crate to its latest major version, 0.9.0. This upgrade necessitated specific code adjustments to accommodate the breaking changes in the new snafu release, ensuring the project remains compatible and benefits from the latest features and improvements of the library. The change also brings an updated minimum supported Rust version requirement.

Highlights

  • Dependency Upgrade: Upgraded the snafu and snafu-derive crates to version 0.9.0, addressing breaking changes introduced in this new major release.
  • Code Adaptation: Modified prescript/src/lib.rs to remove deprecated #[snafu(provide(...))] attributes, ensuring compatibility with SNAFU 0.9.0.
  • Minimum Supported Rust Version (MSRV): The upgrade to SNAFU 0.9.0 implies an update to the minimum supported Rust version to 1.65, targeting 1.81 by default.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • Cargo.lock
    • Updated snafu from version 0.8.5 to 0.9.0 and its corresponding checksum.
    • Updated snafu-derive from version 0.8.5 to 0.9.0 and its corresponding checksum.
  • Cargo.toml
    • Updated the snafu dependency version from 0.8.5 to 0.9.0.
  • prescript/src/lib.rs
    • Removed the #[snafu(provide(opt, ref, chain, dyn std::error::Error => source.as_deref()))] attribute from the AnyWhatever struct.
    • Removed the #[snafu(provide(false))] attribute from the source field within the AnyWhatever struct.
Activity
  • The pull request was opened by shepmaster to provide a compatibility update for the snafu crate to version 0.9.0, including necessary code adjustments for breaking changes.
  • The author noted that SNAFU 0.9.0 updates the minimum supported Rust version to 1.65 and targets 1.81 by default, advising the project maintainers to verify its impact.
  • The author expressed a preference for the changes to be integrated by project approval rather than becoming a long-term contributor.
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.

@shepmaster
Copy link
Copy Markdown
Author

Do note that SNAFU 0.9 makes Whatever Send and Sync, so you might be able to simplify your code here.

Copy link
Copy Markdown

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

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 upgrades the snafu crate from version 0.8.5 to 0.9.0. The changes primarily involve updating Cargo.toml and Cargo.lock files, and removing deprecated #[snafu(provide(...))] attributes in prescript/src/lib.rs to align with the new version's API. While the changes correctly adapt to the snafu upgrade, there's an opportunity to explicitly add the new #[snafu(provide)] attribute to the source and backtrace fields for better clarity and future-proofing, even though it's now the default behavior for #[snafu(whatever)].

@shepmaster
Copy link
Copy Markdown
Author

add the new #[snafu(provide)] attribute to the source

This would be discouraged, as the stable Error::source method should already accomplish the same goal.

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