summaryrefslogtreecommitdiff
path: root/crates/tor-basic-utils/src
Commit message (Collapse)AuthorAgeFilesLines
* tor-basic-utils: Add an if_empty helper macroNick Mathewson2026-05-271-0/+16
| | | | | We need this pattern in a lot of places; we might as well just define it once.
* tor-basic-utils: Correct documentation for macro_first_nonempty.Nick Mathewson2026-05-271-5/+5
| | | | | It looks like we renamed this macro, but didn't rename it in its documentation.
* clippy: Work around bug where it claims method doesn't existIan Jackson2026-05-131-0/+6
| | | | | | | | | | | | Fixes warning: `rand::RngExt::random_range` does not refer to a reachable function --> /volatile/rustcargo/Rustup/Arti/arti/clippy.toml:7:5 | 7 | { path = "rand::RngExt::random_range", reason = "Prefer tor_basic_utils::RngExt::gen_range_checked to avoid uncontrolled panics, or gen_range_infallible if applicable" }, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: add `allow-invalid = true` to the entry to suppress this warning
* Upgrade rand crates to 0.10.Wesley Aptekar-Cassels2026-05-122-3/+4
| | | | | | | | | | | When the circ-padding feature is enabled, we use maybenot, which does not yet support rand 0.10. In the meantime, enabling this feature pulls in rand 0.9. This is not ideal, but should be okay as a temporary situation. This also replaces the use of ReseedingRng (which was removed in 0.10) with the reseeding_rng crate. This is somewhat less performant, but it should be okay.
* tor-basic-utils: remove `flatten`Nick Mathewson2026-05-071-15/+0
| | | | | It is no longer needed since we require Rust 1.89. Nobody was using it.
* tor-basic-utils: Update comment about std::fmt::from_fn.Nick Mathewson2026-05-071-1/+1
| | | | We now know when it was stabilized, so we can say when to use it.
* tor-cert-x509: Port to web-time-compat.Nick Mathewson2026-03-261-2/+2
|
* tor-basic-utils: Remove IoErrorExt and BinaryHeapExt.Nick Mathewson2026-03-251-50/+0
| | | | | | | | | | IoErrorExt existed to provide a workaround for Rust versions that didn't have io::ErrorKind::NotADirectory. But NotADirectory was stabilized in 1.83 and our MSRV is 1.89. BinaryHeapExt existed to provide an implementation for Rust versions that didn't have BinaryHeap::retain. But BinaryHeap::retain was stabilized in 1.70 and our MSRV is 1.70.
* Force use of standard hasher with weak_tables.Nick Mathewson2026-03-241-1/+5
| | | | | | | | | | | | | Closes #2418. Fixes TROVE-2026-005, where we would use a less cryptographically secure (and probably less DoS resistant) hash function for these tables if: - We are built alongside another crate that uses `weak-table` - That crate enables the `weak-table/ahash` feature. - We are running on a system without hardware AES. Severity: Low
* tor-basic-utils: clean up `iter_join`Steven Engler2026-03-031-8/+6
|
* tor-basic-utils: move `iter_join` from arti-relaySteven Engler2026-03-031-0/+33
| | | | Will clean this up in the following commit.
* Merge branch 'ticket_2338' into 'main'Nick Mathewson2026-02-191-10/+2
|\ | | | | | | | | | | | | Use ErrorSources where appropriate to walk an error stack. Closes #2338 See merge request tpo/core/arti!3685
| * tor-basic-utils: Simplify ErrorSources iterator.Nick Mathewson2026-02-161-10/+2
| |
* | Allow clippy::collapsible_if to triggerGabriela Moldovan2026-02-161-0/+1
|/ | | | | | | | | `clippy::collapsible_if` started triggering after bumping the MSRV to 1.88. Since this triggers from a lot of places, and since there even are a couple of instances where we explicitly allow `clippy::collapsible_ifs`, I've opened #2342 for deciding what to do about it.
* tor-basic-utils: Add utility to iterate over error sourcesRobert Bartlensky2026-02-142-0/+113
|
* maint/add_warning: Run script to add new warningGabriela Moldovan2026-01-271-0/+1
| | | | This adds the lint to all our crates.
* Move intern from tor-netdir to tor-basic-utils and make it pubNick Mathewson2025-12-032-0/+132
|
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-069-10/+10
| | | | Run maint/add_warning
* tor-basic-utils: New function to generate random hostname.Nick Mathewson2025-10-072-0/+81
| | | | | | We'll be using this for x509 certificates in #2197. We might also use it for SNI/ESNI as in !198.
* Remove "doc_auto_cfg" incantation from all crates.Nick Mathewson2025-09-291-1/+1
| | | | This feature has been removed from nightly, in favor of doc_cfg.
* Merge branch 'note_result_flatten_msrv' into 'main'David Goulet2025-08-071-2/+3
|\ | | | | | | | | Fix a comment about Result::flatten See merge request tpo/core/arti!3138
| * Fix a comment about Result::flattenNick Mathewson2025-08-071-2/+3
| | | | | | | | Previously this API was nightly-only; now it's in 1.89.
* | Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-072-4/+5
|/ | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* tor-basic-utils: add `assert_val_impl_trait!` macroSteven Engler2025-07-171-0/+19
|
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* tor-linkspec,tor-basic-utils: remove deprecated `empty_iterator()` methodSteven Engler2025-05-141-20/+0
| | | | | | This method has always been deprecated, so it's not a big deal to remove. It can be replaced with the corresponding iterators's `Default` implementation.
* tor-basic-utils: standardized MSRV TODOshashcatHitman2025-04-162-4/+4
| | | | | - Part of a series of commits aimed at replacing all MSRV-related TODOs with a standardized format, which should be easier to find when the MSRV is bumped.
* 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
|