Why does RateLimiter::check_at take &mut self? Nothing in that function looks like it needs a mutable reference to self.
It only accesses the dashmap, and none of dashmap's functions need a mutable reference (that's the entire point of dashmap).
With the requirement for a mutable reference to self, the promise from the README "Implements Send + Sync so can be used asynchronously." is kinda moot, since the only way to share a value which can be mutated is through Mutex or similar methods.
Why does
RateLimiter::check_at
take&mut self
? Nothing in that function looks like it needs a mutable reference to self.It only accesses the dashmap, and none of dashmap's functions need a mutable reference (that's the entire point of dashmap).
With the requirement for a mutable reference to self, the promise from the README "Implements
Send + Sync
so can be used asynchronously." is kinda moot, since the only way to share a value which can be mutated is throughMutex
or similar methods.