Skip to content

Conversation

@MrCroxx
Copy link
Member

@MrCroxx MrCroxx commented Apr 11, 2024

What's changed and what's your intention?

Please explain IN DETAIL what the changes are in this PR and why they are needed. :D

As title.

e.g.

pub fn get(&self, key: &K) -> Option<CacheEntry<K, V, L, S>>;

will be replaced with

unsafe fn get<Q>(&mut self, hash: u64, key: &Q) -> Option<NonNull<H>>
    where
        K: Borrow<Q>,
        Q: Hash + Eq + ?Sized;

to loose query key bound like:

let entry = cache.insert("hello".to_string(), "world".to_string(), 1);
let e = cache.get(&"hello".to_string()).unwrap();

can be rewritten with

let entry = cache.insert("hello".to_string(), "world".to_string(), 1);
let e = cache.get("hello").unwrap();

Checklist

  • I have written the necessary rustdoc comments
  • I have added the necessary unit tests and integration tests
  • I have passed make all (or make fast instead if the old tests are not modified) in my local environment.

Related issues or PRs (optional)

@MrCroxx MrCroxx self-assigned this Apr 11, 2024
@MrCroxx MrCroxx enabled auto-merge (squash) April 11, 2024 17:27
@MrCroxx MrCroxx merged commit cc64fc9 into main Apr 11, 2024
@MrCroxx MrCroxx deleted the xx/loose branch April 11, 2024 17:33
MrCroxx added a commit that referenced this pull request Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants