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

Make MemHistory::default() be a wrapper around MemHistory::new() to avoid that max_len is defaulted to 0. #686

Merged
merged 1 commit into from
Mar 5, 2023

Conversation

tage64
Copy link
Contributor

@tage64 tage64 commented Mar 5, 2023

I found that when creating MemHistory from Default::default(), the max_len (that is the maximum size of the history) is initialized to 0 due to the #[derive(Default)] on the MemHistory struct.
This is counter intuative since the history doesn't work as a history at all in that case.

I changed the Default implementation to call MemHistory::new() instead. Then the history max length will be initialized to 100 instead.

@gwenn gwenn merged commit ea75adf into kkawakam:master Mar 5, 2023
@gwenn
Copy link
Collaborator

gwenn commented Mar 5, 2023

Thanks.

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.

2 participants