antifuchs / ratelimit_meter

A leaky-bucket-as-a-meter rate-limiting implementation in Rust
MIT License
33 stars 6 forks source link

Revamp Constructors #2

Closed antifuchs closed 7 years ago

antifuchs commented 7 years ago

This is for 0.3.0: The constructors I'd defined at the start of this project are too generic and simultaneously straight-jacket-y. There's no need for them to return Result, as everything has reasonable defaults.

So, let's make the constructor interface better:

The result is a much nicer-looking experience. Witness the test code, for example.