Skip to content

build(deps): replace schnellru with lru implementation#1066

Merged
0x676e67 merged 3 commits intomainfrom
build
Feb 14, 2026
Merged

build(deps): replace schnellru with lru implementation#1066
0x676e67 merged 3 commits intomainfrom
build

Conversation

@0x676e67
Copy link
Owner

Since schnellru seems to be unmaintained, we've decided to switch to lru instead

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @0x676e67, 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 updates the project's dependency management by swapping an unmaintained LRU cache library for a currently supported alternative. This change ensures the continued stability and maintainability of components relying on LRU caching, while also incorporating minor type improvements for better consistency within the Rust ecosystem.

Highlights

  • Dependency Replacement: The schnellru crate has been replaced with the lru crate due to schnellru being unmaintained. This affects the Cargo.toml and several source files where LRU cache functionality is used.
  • Type Modernization: Instances of NonZeroU32 have been updated to NonZeroUsize across the codebase, aligning with more idiomatic Rust practices for size-related types.
  • LRU Cache API Migration: Code interacting with LRU caches has been updated to use the lru crate's API, including changes to cache initialization, insertion (put instead of insert), retrieval (get_mut instead of get), and eviction methods (pop_lru instead of pop_oldest, pop instead of remove).
Changelog
  • Cargo.toml
    • Replaced schnellru dependency with lru.
  • src/client/http.rs
    • Updated NonZeroU32 import to NonZeroUsize.
    • Changed pool_max_size field type in Config struct from Option<NonZeroU32> to Option<NonZeroUsize>.
    • Modified pool_max_size builder method to accept usize and use NonZeroUsize.
  • src/client/http/client.rs
    • Updated NonZeroU32 import to NonZeroUsize.
    • Changed pool_max_size builder method parameter type from Option<NonZeroU32> to Option<NonZeroUsize>.
  • src/client/http/client/pool.rs
    • Updated NonZero import to NonZeroUsize.
    • Replaced schnellru::ByLength import with lru::LruCache.
    • Changed max_pool_size field type in Config struct from Option<NonZero<u32>> to Option<NonZeroUsize>.
    • Modified Pool initialization to use LruCache::with_hasher or LruMap::unbounded_with_hasher based on max_pool_size.
    • Updated idle list insertion logic to use get_or_insert_mut.
    • Changed idle list removal to use pop instead of remove.
    • Modified idle list retrieval to use get_mut instead of get.
  • src/hash.rs
    • Removed schnellru::ByLength import.
    • Updated LruMap type alias to use lru::LruCache instead of schnellru::LruMap.
  • src/tls/conn/cache.rs
    • Added NonZeroUsize import.
    • Removed schnellru::ByLength import.
    • Modified per_host_sessions initialization to use LruMap::unbounded_with_hasher or LruMap::with_hasher.
    • Changed session eviction to use pop_lru instead of pop_oldest.
    • Updated session insertion to use put instead of insert.
    • Modified session retrieval to use peek_lru instead of peek_oldest.
    • Changed session removal to use pop instead of remove.
Activity
  • No human activity has been recorded on this pull request yet.
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.

Copy link
Contributor

@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 replaces the schnellru dependency with lru, which is a good move as schnellru appears to be unmaintained. The changes mostly consist of API migration, which has been done consistently across the codebase. However, I've found a few instances where it seems non-existent methods from the lru crate are being called, which would likely cause compilation failures. I've provided specific comments and suggestions to address these issues.

@0x676e67 0x676e67 merged commit 13c9586 into main Feb 14, 2026
23 checks passed
@0x676e67 0x676e67 deleted the build branch February 14, 2026 14:37
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

Comments