-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
Manipulating bytes as `usize`s is... clunky. I find myself commenting on relevant lines with the value converted in the most relevant unit (e.g. MB or GB). That's a clear-cut code smell if I've ever seen one. We introduce `ByteUnit` by re-exporting from the `ubyte` crate. It is used in [`rocket`](https://api.rocket.rs/master/rocket/data/struct.ByteUnit.html) and it fits our needs perfectly.⚠️ Breaking change: I renamed `max_n_bytes` to `max_size` in `BodySizeLimit`. The type has also changed from `usize` to `ByteUnit`. This impacts you if you were registering a custom constructor for `BodySizeLimit`. The same applies to the `SizeLimitExceeded` error.
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,4 @@ pub mod router; | |
pub mod serialization; | ||
#[cfg(feature = "server")] | ||
pub mod server; | ||
pub mod unit; |