Skip to content
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

refactor(cache): remove deref impl on Cache type #4671

Merged
merged 2 commits into from
May 20, 2024

Conversation

Chethan-rao
Copy link
Contributor

@Chethan-rao Chethan-rao commented May 17, 2024

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Currently Cache is a type having inner value as MokaCache.

pub struct Cache {
    inner: MokaCache<String, Arc<dyn Cacheable>>,
}

There's a deref impl on this type which returns the inner MokaCache. We should instead have custom methods on Cache which calls the MokaCache methods instead of deref doing the job. There's already custom methods available on Cache. This PR refactors it to invoke these methods instead of calling it on the deref of Cache.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

How did you test it?

Basic sanity tests should suffice

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@Chethan-rao Chethan-rao added S-waiting-on-review Status: This PR has been implemented and needs to be reviewed C-refactor Category: Refactor labels May 17, 2024
@Chethan-rao Chethan-rao added this to the May 2024 Release milestone May 17, 2024
@Chethan-rao Chethan-rao self-assigned this May 17, 2024
@Chethan-rao Chethan-rao requested a review from a team as a code owner May 17, 2024 10:26
@Chethan-rao Chethan-rao linked an issue May 17, 2024 that may be closed by this pull request
@Chethan-rao Chethan-rao changed the title refactor(cache): remove deref impl on Cache type refactor(cache): remove deref impl on Cache type May 17, 2024
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue May 20, 2024
Merged via the queue into main with commit 36409bd May 20, 2024
10 checks passed
@Gnanasundari24 Gnanasundari24 deleted the remove-deref-on-cache branch May 20, 2024 13:58
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-refactor Category: Refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REFACTOR] remove deref impl on Cache type
4 participants