summaryrefslogtreecommitdiff
path: root/crates/tor-netdir/src/weight.rs
Commit message (Collapse)AuthorAgeFilesLines
* Remove allow(clippy::disallowed_methods) lint.Nick Mathewson2022-03-301-1/+0
|
* use wallclock where possible in teststrinity-1686a2022-02-261-0/+1
|
* tor-netdir: Resolve an XXXX about type uglinessNick Mathewson2021-12-081-4/+5
| | | | | | | | | | | | | | | We had no function to infallibly convert BoundedInt32<{0 or 1},H> into a u32, even though we could have. Because of that, we were treating weight_scale as an i32 when logically it's a u32 or a NonZeroU32. Moreover, it turns out we were using an incorrect minimum for the bwweightscale param, which would in theory have allowed the authorities to make us divide by zero. This patch introduces the necessary From<> implementation and uses it. It corrects the binimum bwweightscale, and prevents a division-by-zero issue in case weight_scale is zero.
* tor-netdir: Use bitflags for WeightKindNeel Chauhan2021-11-301-34/+49
|
* Merge remote-tracking branch 'origin/mr/71'Nick Mathewson2021-09-081-0/+1
|\
| * fix/silence clippy lints in test modulesDaniel Eades2021-09-081-0/+1
| |
* | Add validation function to WeightSetNick Mathewson2021-09-081-1/+18
|/ | | | | Our relay selection code can give wrong answers if we overflow u64::MAX, so let's make sure we never do that.
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+625
This will cause some pain for now, but now is really the best time to do this kind of thing.