summaryrefslogtreecommitdiff
path: root/crates/tor-basic-utils/src
Commit message (Collapse)AuthorAgeFilesLines
* tor-basic-utils: move `flatten` from tor-protoSteven Engler2025-03-251-0/+14
| | | | I also added an additional non-doc TODO comment.
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-1/+5
| | | | - `Rng::gen_range()` has been renamed to `Rng::random_range()`
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-6/+6
| | | | - The rand::distributions module has been renamed to rand::distr
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-182-4/+4
| | | | - `rand::thread_rng()` has been deprecated and renamed to `rand::rng()`
* Always use full path to rand::thread_rng().Nick Mathewson2025-03-181-4/+2
| | | | | This is partly for consistency, and partly to facilitate a global search-and-replace.
* clippy: deny `mod_module_files`Steven Engler2025-01-061-0/+1
| | | | | | Denies 'mod.rs' files for consistency. https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
* add_warnings, *: Allow clippy::needless_lifetimesNick Mathewson2024-12-031-0/+1
| | | | | | | | In 1.83, this warning triggers on many of our crates. We're thinking of fixing them all, but for now, we're going to disable the warning. This is part of #1765.
* tor-basic-utils: Change a function to not be unsafeIan Jackson2024-10-081-2/+2
| | | | | This is not a memory safety requirement. We don't need `unsafe` here, so we shoudln't have it.
* tor-basic-utils: add `n_key_list` macroSteven Engler2024-09-232-0/+775
| | | | | This is based off of the `n_key_set` macro, but lets you store multiple items per key.
* tor-basic-utils: small doc changes to `n_key_set`Steven Engler2024-09-231-3/+2
|
* Fix typosDimitris Apostolou2024-09-032-2/+2
|
* byte_qty: Support deserialising from strings and floatsIan Jackson2024-08-271-1/+76
| | | | This finally makes this type suitable for parsing in config files.
* byte_qty: Implement FromStr, and improve Display implIan Jackson2024-08-271-7/+189
| | | | Display can now choose appropriate units.
* byte_qty: provide TryFrom<u64> and <f64>Ian Jackson2024-08-271-0/+76
|
* byte_qty: Make serde dependency optional in tor-basic-utilsIan Jackson2024-08-271-2/+7
|
* byte_qty: Split up the derivesIan Jackson2024-08-271-1/+2
| | | | The serde ones are going to need to be conditional.
* byte_qty: Move to tor-basic-utilsIan Jackson2024-08-272-0/+72
| | | | Code motion of byte_qty.rs, and minimal necessary supporting changes.
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* Use uXX::MAX in place of std::uXX::MAXNick Mathewson2024-04-221-2/+2
| | | | | | The old code produced a warning from clippy nightly; we may as well update to use the new associated consts. (They've been there since Rust 1.4x.)
* Run maint/add_warning.Nick Mathewson2024-03-136-0/+6
|
* Fix typos in doc commentsTobias Stoeckmann2024-03-061-2/+2
|
* tor-basic-utils: Provide PathExt with display_lossy() methodIan Jackson2024-03-051-0/+25
|
* deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
|
* tor-basic-utils: Seal IoErrorExtIan Jackson2023-10-101-1/+9
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-236-0/+6
|
* Resolve warnings about ambiguous/redundant doc linksNick Mathewson2023-08-221-2/+2
| | | | | Nightly rustdoc now warns if you have a link that isn't necessary, and if you have a link that might refer to two different things.
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* Merge branch 'clippy-allow' into 'main'Ian Jackson2023-07-116-0/+7
|\ | | | | | | | | clippy: Allow some of our existing code patterns See merge request tpo/core/arti!1396
| * Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-106-0/+7
| |
* | rng docs: Fix two linksIan Jackson2023-07-101-2/+2
| |
* | rng ranges: Provide examples (doctests)Ian Jackson2023-07-101-0/+42
| |
* | rng ranges: Forbid use of panicky Rng::gen_rangeIan Jackson2023-07-101-0/+1
| | | | | | | | Fixes #920
* | rng ranges: Introduce gen_range_infallibleIan Jackson2023-07-101-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | There are a number of places where we generate random Durations in a range which starts at zero. These call sites currently (i) have to write out Duration::ZERO or equivalent, and (ii) would have to use gen_range_checked and expect the result, even though it can be statically proven to be OK. To make this slightly smoother, provide `GenRangeInfallible` and `gen_range_infallible`.
* | tor-basic-utils: retry: Use and justify gen_range_checkedIan Jackson2023-07-101-3/+4
| | | | | | | | | | delay_bounds's implementation ensures the postcondition, so the potential p[anic in next_delay_msec cannot happen.
* | rng ranges: Introduce RngExt and gen_range_checkedIan Jackson2023-07-101-0/+27
|/ | | | We will use this in many places instead of gen_range.
* Run add_warning to remove `missing_panics_doc` deny.Nick Mathewson2023-07-061-1/+0
| | | | Closes #950.
* lints: Run maint/add_warning to actually apply new lintsIan Jackson2023-06-211-0/+2
|
* tor-basic-utils: Add unbounded range (..) test.Gabriela Moldovan2023-05-131-0/+31
| | | | Signed-off-by: Gabriela Moldovan <[email protected]>
* tor-basic-utils: Update combinatorial test to randomly choose an open or ↵Gabriela Moldovan2023-05-131-2/+12
| | | | | | closed bound. Signed-off-by: Gabriela Moldovan <[email protected]>
* tor-basic-utils: Add rangebounds test with time ranges.Gabriela Moldovan2023-05-131-0/+35
| | | | Signed-off-by: Gabriela Moldovan <[email protected]>
* tor-basic-utils: Assert witness is not part of the intersection.Gabriela Moldovan2023-05-131-0/+4
| | | | Signed-off-by: Gabriela Moldovan <[email protected]>
* tor-basic-utils: Log the ranges/intersection on assertion failure.Gabriela Moldovan2023-05-131-1/+13
| | | | Signed-off-by: Gabriela Moldovan <[email protected]>
* tor-checkable: Implement RangeBounds for TimerangeBound.Gabriela Moldovan2023-05-131-2/+2
| | | | | | | | By implementing `RangeBounds` for `TimerangeBound`, we get `RangeBoundsExt` for free. This will enable `parse_decrypt_validate` to easily compute the intersection of the `TimerangeBound`s its layers. Signed-off-by: Gabriela Moldovan <[email protected]>
* tor-basic-utils: Add a helper function to deduplicate test code.Gabriela Moldovan2023-05-131-19/+29
| | | | Signed-off-by: Gabriela Moldovan <[email protected]>
* tor-basic-utils: Add RangeBoundsExt trait.Gabriela Moldovan2023-05-132-0/+201
| | | | Signed-off-by: Gabriela Moldovan <[email protected]>
* tor-netdir: Shuffle the list of HS dirs used for downloading descriptors.Gabriela Moldovan2023-05-041-1/+1
| | | | | | | | We'll probably need the hsdir list to be shuffled deterministically for testing purposes (this might be desirable, for example, when we write a test for HS descriptor download retries). Signed-off-by: Gabriela Moldovan <[email protected]>
* impl_debug_hex: Fix syntax error in usage templateIan Jackson2023-04-111-1/+1
| | | | Corrects the doc and fixes a rustdoc warning.
* tor-basic-utils: Provide impl_debug_hexIan Jackson2023-03-311-0/+82
|
* Move functionality from tor_basic_utils to tor_async_utilsNick Mathewson2023-03-292-731/+0
| | | | | This commit is mostly code movement; I'd recommend reviewing it with git's `--color-moved` option.
* Introduce and use ends_with_ignore_ascii_caseIan Jackson2023-03-081-1/+6
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1056#note_2884428