You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are interested in using this crate but we'd like to always use the "fast path" because accuracy is not that important for our usecase.
Unfortunately, we are a library crate (libp2p) and if we activate the feature-flag added in #3, then we will change the behaviour for the entire dependency tree which is not something that we want to force onto our users.
I'd like to suggest to consider the following design:
Remove the feature-flag
Offer two functions in the API (names subject to bike-shedding):
accurate_memory_stats
fast_memory_stats
Both functions return Option<MemoryStats>
Users can compose their own fallback behaviour using Option::or
In general, feature flags in cargo should never change code behaviour but only add additional APIs.
The text was updated successfully, but these errors were encountered:
Hi!
We are interested in using this crate but we'd like to always use the "fast path" because accuracy is not that important for our usecase.
Unfortunately, we are a library crate (
libp2p
) and if we activate the feature-flag added in #3, then we will change the behaviour for the entire dependency tree which is not something that we want to force onto our users.I'd like to suggest to consider the following design:
accurate_memory_stats
fast_memory_stats
Option<MemoryStats>
Option::or
In general, feature flags in cargo should never change code behaviour but only add additional APIs.
The text was updated successfully, but these errors were encountered: