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

fix: Make Lazy and LazyOption debug impls match #897

Merged
merged 5 commits into from
Aug 30, 2022

Conversation

austinabell
Copy link
Contributor

Noticed when working on related things that these were not matching. This should be resolved before #888 comes in, but is a separate issue

What this proposes is including the cached value in debug output but keeping the type as an Option so that we can change the implementation without breaking this format. Can alternatively just keep the default debug derive or ignore cache, but the cache seems important for debug purposes. (Maybe not obfuscating the cache entry type is valuable to see if a value has been flushed to storage)?

@ChaoticTempest
Copy link
Member

hmm, maybe adding an extra field where we show whether it has been flushed or not based on the EntryState would also be nice? Like:

cached { flushed: true, value: Some(8) }

@austinabell
Copy link
Contributor Author

Just debug output the CacheEntry type. Not worth adding code size for a new type with debug

@austinabell austinabell merged commit a6d876e into master Aug 30, 2022
@austinabell austinabell deleted the austin/lazy_debug_m branch August 30, 2022 12:32
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.

3 participants