summaryrefslogtreecommitdiff
path: root/crates/tor-basic-utils
Commit message (Collapse)AuthorAgeFilesLines
...
* | 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.
* Bump versions on crates with nonfunctional changesNick Mathewson2023-06-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These crates have had nonfunctional changes only, mostly due to !1271, or ac90cb7500f2f108, or documentation changes: crates that depend on them do not require a version bump. ``` arti-bench arti-config arti-hyper arti-testing caret fs-mistrust retry-error tor-async-utils tor-basic-utils tor-chanmgr tor-checkable tor-congestion tor-consdiff tor-events tor-guardmgr tor-persist tor-protover tor-ptmgr tor-rtcompat tor-rtmock tor-units ```
* lints: Run maint/add_warning to actually apply new lintsIan Jackson2023-06-211-0/+2
|
* Bump crate versions in preparation for v1.1.5 release.Nick Mathewson2023-06-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generated with the following commands: ``` cargo set-version --bump minor -p tor-cell cargo set-version --bump minor -p tor-linkspec cargo set-version --bump minor -p tor-proto cargo set-version --bump minor -p tor-netdoc cargo set-version --bump minor -p tor-circmgr cargo set-version --bump patch -p tor-cert cargo set-version --bump patch -p tor-basic-utils cargo set-version --bump patch -p tor-rpcbase cargo set-version --bump patch -p tor-llcrypto cargo set-version --bump patch -p tor-hscrypto cargo set-version --bump patch -p tor-checkable cargo set-version --bump patch -p tor-async-utils cargo set-version --bump patch -p caret cargo set-version --bump patch -p fs-mistrust cargo set-version --bump patch -p safelog cargo set-version --bump patch -p retry-error cargo set-version --bump patch -p tor-error cargo set-version --bump patch -p tor-config cargo set-version --bump patch -p tor-events cargo set-version --bump patch -p tor-units cargo set-version --bump patch -p tor-rtcompat cargo set-version --bump patch -p tor-rtmock cargo set-version --bump patch -p tor-protover cargo set-version --bump patch -p tor-bytes cargo set-version --bump patch -p tor-socksproto cargo set-version --bump patch -p tor-consdiff cargo set-version --bump patch -p tor-netdir cargo set-version --bump patch -p tor-congestion cargo set-version --bump patch -p tor-persist cargo set-version --bump patch -p tor-chanmgr cargo set-version --bump patch -p tor-ptmgr cargo set-version --bump patch -p tor-guardmgr cargo set-version --bump patch -p tor-dirclient cargo set-version --bump patch -p tor-dirmgr cargo set-version --bump patch -p tor-hsclient cargo set-version --bump patch -p tor-hsservice cargo set-version --bump patch -p arti-client cargo set-version --bump patch -p arti-rpcserver cargo set-version --bump patch -p arti-config cargo set-version --bump patch -p arti-hyper cargo set-version --bump patch -p arti cargo set-version --bump patch -p arti-bench cargo set-version --bump patch -p arti-testing ```
* Run fixup-features --no-annotate for initial Cargo.toml fixes.Nick Mathewson2023-05-151-0/+3
| | | | | | | | | This does the following: - Gives every crate a `full`. - Cause every `full` to depend on `full` from the lower-level crates. - Makes every feature listed _directly_ in `experimental` depend on `__is_experimental`.
* 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]>
* Increment crate versions.Nick Mathewson2023-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because of the errorkind bumps, we're calling this a breaking change in everything lower-level than `arti`. Generated with: ``` cargo set-version -p tor-basic-utils --bump minor cargo set-version -p tor-async-utils --bump minor cargo set-version -p caret --bump minor cargo set-version -p fs-mistrust --bump minor cargo set-version -p safelog --bump minor cargo set-version -p retry-error --bump minor cargo set-version -p tor-error --bump minor cargo set-version -p tor-config --bump minor cargo set-version -p tor-events --bump minor cargo set-version -p tor-units --bump minor cargo set-version -p tor-rtcompat --bump minor cargo set-version -p tor-rtmock --bump minor cargo set-version -p tor-rpcbase --bump minor cargo set-version -p tor-llcrypto --bump minor cargo set-version -p tor-protover --bump minor cargo set-version -p tor-bytes --bump minor cargo set-version -p tor-hscrypto --bump minor cargo set-version -p tor-socksproto --bump minor cargo set-version -p tor-checkable --bump minor cargo set-version -p tor-cert --bump minor cargo set-version -p tor-linkspec --bump minor cargo set-version -p tor-cell --bump minor cargo set-version -p tor-proto --bump minor cargo set-version -p tor-netdoc --bump minor cargo set-version -p tor-consdiff --bump minor cargo set-version -p tor-netdir --bump minor cargo set-version -p tor-congestion --bump minor cargo set-version -p tor-persist --bump minor cargo set-version -p tor-chanmgr --bump minor cargo set-version -p tor-ptmgr --bump minor cargo set-version -p tor-guardmgr --bump minor cargo set-version -p tor-circmgr --bump minor cargo set-version -p tor-dirclient --bump minor cargo set-version -p tor-dirmgr --bump minor cargo set-version -p tor-hsclient --bump minor cargo set-version -p tor-hsservice --bump minor cargo set-version -p arti-client --bump minor cargo set-version -p arti-rpcserver --bump minor cargo set-version -p arti-config --bump minor cargo set-version -p arti-hyper --bump minor cargo set-version -p arti --bump patch cargo set-version -p arti-bench --bump patch cargo set-version -p arti-testing --bump patch ```
* Increment MSRV to 1.65 in every crate.Nick Mathewson2023-04-111-1/+1
|
* 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
|
* Remove semver.md files.Nick Mathewson2023-03-311-1/+0
|
* Bump crate versions that have breaking changesNick Mathewson2023-03-311-1/+1
| | | | | | | | | | These crates have had breaking changes. They are pre-1.0, so they get a minor bump. ``` tor-basic-utils tor-config ```
* Move functionality from tor_basic_utils to tor_async_utilsNick Mathewson2023-03-294-737/+1
| | | | | 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
* tor-basic-utils: Provide str.strip_suffix_ignore_ascii_caseIan Jackson2023-03-081-0/+44
| | | | We're going to want this for cheaply stripping ".onion" from things.
* Bump the patch version of each crate with _trivial_ changes.Nick Mathewson2023-02-011-1/+1
| | | | | These crates have not had changes to their behavior; as such it is not necessary to bump their dependencies to require the new versions.
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-275-0/+5
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* Disable clippy::unlinlined-format-argsNick Mathewson2023-01-271-0/+1
| | | | | | | | This warning kind of snuck up on us! (See #748) For now, let's disable it. (I've cleaned it up in a couple of examples, since those are meant to be more idiomatic and user-facing.) Closes #748.
* Merge branch 'test-lints' into 'main'eta2023-01-063-1/+26
|\ | | | | | | | | Add test lint blocks to all "mod test" See merge request tpo/core/arti!937
| * test lint blocks: Add many many automaticallyIan Jackson2022-12-122-0/+17
| | | | | | | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
| * test lint blocks: Do some semi-manuallyIan Jackson2022-12-121-1/+9
| | | | | | | | | | | | | | This is the hunks from running the rune in maint/adhoc-add-lint-blocks but which require some subsequent manual fixup: usually, deleting now-superfluous outer allows, but in some cases manually putting back lints that the adhoc script deleted.
* | doc: consistent summary line for the READMEsEmil Engler2022-12-201-1/+1
|/ | | | | This commit introduces a consistency to the summary line of all README.md files in each and every crate.
* Remove semver.md files now that 1.1.0 is released.Nick Mathewson2022-11-301-3/+0
|
* Bump the minor version of every crate.Nick Mathewson2022-11-301-1/+1
| | | | | We made this job easy this time around: by incrementing our MSRV, we have forced ourselves to do at least a minor bump everywhere.
* tor-basic-utils: DropNotifyWatchSender: use DropNotifyEofSignallableIan Jackson2022-11-232-7/+38
| | | | | This will help avoid the programmer making the mistake I made here: https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/852#note_2854029
* tor-basic-utils: DropNotifyWatchSender test: introduce IIan Jackson2022-11-231-6/+9
| | | | | We do want to test this with a non-Option type, but we are going to have to wrap it up.
* tor-basic-utils: Provide helper for serde flexible parsingIan Jackson2022-11-213-0/+92
|
* bump rust-version to 1.60 in every crate.Nick Mathewson2022-11-101-1/+1
|
* define_accessor_trait: Allow specification of other itemsIan Jackson2022-11-031-1/+10
|
* define_accessor_trait: Allow specification of supertraitsIan Jackson2022-11-031-4/+8
|
* Run add_warnings.Nick Mathewson2022-11-031-0/+1
|
* Require derive_more 0.99.3Ian Jackson2022-11-031-1/+1
| | | | | | | | 0.99.[012] have a bug https://github.com/JelteF/derive_more/issues/114 which makes the Deref derive for bridgedesc::StateGuard not work and therefore breaks minimal-versions CI. It seems simpler to require the newer version everywhere.
* tor-basic-utils: Provide an implementation of BinaryHeap::retainIan Jackson2022-10-272-0/+23
| | | | | | This is currently nightly-only and is blocked on an unresolved API question: https://github.com/rust-lang/rust/issues/71503
* n_key_set: clean up some wide linesNick Mathewson2022-10-241-21/+38
|
* n_key_set: Re-insert by_foo_mut() accessors, but make them unsafe.Nick Mathewson2022-10-241-0/+21
|
* Fix some litter in a doc comment.Nick Mathewson2022-10-241-1/+1
|
* n_key_set: Add ability to modify entries in the map.Nick Mathewson2022-10-241-1/+118
| | | | | | The keys can change: if they do, then the entry is removed from its previous position and inserted at the new one, possibly displacing others.
* cargo fmt to remove blank linesIan Jackson2022-10-121-1/+0
| | | | | | | Apparently cargo fmt doesn't like these, which my perl rune didn't delete. This commit is precisely the result of `cargo fmt`.