summaryrefslogtreecommitdiff
path: root/crates/arti-testing/src
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* maint/add_warning: Run script to add new warningGabriela Moldovan2026-01-271-0/+1
| | | | This adds the lint to all our crates.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* all: run cargo fmtSteven Engler2025-11-041-1/+1
|
* all: replace all uses of `futures::task::SpawnExt` with `tor_rtcompat::SpawnExt`Steven Engler2025-11-041-1/+1
|
* tor-netdoc: Mirror netdoc structure in RouterStatus document digestsIan Jackson2025-10-151-1/+1
| | | | | | | | In md consensuses the referenced document digest is in the `m` field. This seems to be to make it similar to votes. But really the function of the md desc hash in md rs entries is much more parallel to the plain desc hash in plain rs entries. The way the spec has done it means the `r` item has a needlessly different syntax.
* tor-netdoc: RouterStatus: Split out the `r` item's fieldsIan Jackson2025-10-151-1/+1
| | | | | | | | | This makes the Rust structure closer to the document structure. Arguably, this makes the Rust structure worse. But: I'm really very keen on avoiding handwritten parsing and printing code. And, in the longer term, having this linkage will hopefully apply pressure to avoid further protocol complexity/variation/chaos.
* tor-netdoc: Apply much rustfmt churnIan Jackson2025-08-261-4/+1
|
* tor-netdoc: Combine ConsensusRouterStatus and GenericRouterStatusIan Jackson2025-08-261-1/+1
| | | | Now we only need one type.
* tor-netdoc: Abolish RouterStatus trait in favour of generic methodsIan Jackson2025-08-261-1/+1
| | | | | Our approach to sharing code between md and plain consensuses is now the new "variety" system, not generics.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-074-5/+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.
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-3/+3
| | | | - The Rng::gen() functions have been renamed to Rng::random().
* 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-2/+1
| | | | | This is partly for consistency, and partly to facilitate a global search-and-replace.
* tor-rtcompat: Rename UnsupportedStreamOps to NoOpStreamOpsHandle (fmt).Gabriela Moldovan2025-01-151-1/+1
|
* tor-rtcompat: Rename UnsupportedStreamOps to NoOpStreamOpsHandle.Gabriela Moldovan2025-01-151-2/+2
| | | | | This renames UnsupportedStreamOpsHandle to NoOpStreamOpsHandle for clarity (the old name kind of sounded like the name of an error type).
* tor-rtcompat: Implement new_handle() using TcpSockFd (fmt).Gabriela Moldovan2025-01-151-1/+3
|
* tor-rtcompat: Implement new_handle() using TcpSockFd.Gabriela Moldovan2025-01-151-1/+8
|
* tor-rtcompat: Add the ability to get a StreamOps handle.Gabriela Moldovan2025-01-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | Needed for cases where we wrap an object that implements `StreamOps` in an external type, thereby losing access to the `StreamOps` functionality. For example, during the channel handshake, we `.split()` the stream that implements `StreamOps`, which leaves us with a `SplitSink` and a `SplitStream`, neither of which implement `StreamOps`. Getting a handle to the underlying object that implements `StreamOps` (for example, a file handle) *before* the stream is `.split()` enables us to use `StreamOps` to manipulate the underlying split stream. This commit also introduces a special `UnsupportedStreamOpsHandle`, which is a type that implements `StreamOps`, but always returns an error. This type is meant to simplify error handling and usage, and is meant to be used in cases where `StreamOps` is not supported. TODO: the name of this type is pretty confusing (it's very similar to `UnsupportedStreamOp`, which is an error type), and should probably be renamed to something else (`NoOpStreamOpsHandle`, `BrokenStreamOpsHandle`, `DummyStreamOpsHandle` come to mind...). Note: this changes the `StreamOps` trait to be slightly different from what I originally envisioned in !2660 and #1769
* 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
* tor-rtcompat: Implement StreamOps for all the stream types.Gabriela Moldovan2024-12-102-2/+17
| | | | Part of #1769
* 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.
* TimerangeBound: Stop using std::ops::Bound.Wesley Aptekar-Cassels2024-11-251-6/+12
| | | | Fixes: #1691
* rtcompat: remove async_trait from NetStreamListener.Nick Mathewson2024-09-242-2/+0
| | | | (The trait no longer has any async methods.)
* Make Runtime require NetStreamProvider<unix::SocketAddr>Nick Mathewson2024-09-241-2/+2
|
* Documentation updates for "NetStreamProvider" renameNick Mathewson2024-09-242-4/+4
| | | | | | Stop referring to TCP streams in its documentation; update other documentation to refer to NetStreamProvider rather than TcpProvider.
* rtcompat: Rename TcpProvider to NetStreamProvider.Nick Mathewson2024-09-242-17/+17
| | | | | | | | | | | | | | (And similarly rename TcpListener to NetStreamListener, along with their TcpStream/TcpListener associated types.) These types are about to become generic over addresses, and therefore shouldn't be named after TCP. Renaming was done mostly with Rust Analyzer, except for some macros that needed to be hand-edited. (I'll revise the comments in the next commit; this one is all about renaming.)
* rtcompat: Remove accept() from TcpListenerNick Mathewson2024-09-242-19/+0
| | | | | | | | | | It's redundant with the incoming() method (which turns the TcpListener into a Stream of connections), and nothing actually used it outside of tests. Removing this method allows us to simplify our TcpListener code a good deal, as can be seen by some of the implementations we removed from our example and testing code.
* rtcompat: Add an extension trait for building modified RuntimesNick Mathewson2024-09-241-9/+2
| | | | | | | With this extension trait, we no longer need to construct `CompoundRuntime` directly outside of tor-rtcompat. This in turn will make it a little less painful when we have to add more generics to CompoundRuntime.
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* tor-rtcompat: CompoundRuntime: Add a CoarseTimeProvider, and implIan Jackson2024-03-251-0/+1
| | | | | | In all the uses in-crate, this is just a RealCoarseTimeProvider. Now all the compound runtimes impl CoarseTimeProvider.
* deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
|
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* Merge branch 'clippy-allow' into 'main'Ian Jackson2023-07-111-0/+1
|\ | | | | | | | | 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-101-0/+1
| |
* | rng ranges: Use gen_range_infallible() for Duration::ZERO..=TIan Jackson2023-07-101-2/+3
|/
* rng ranges: Use inclusive Duration ranges in several placesIan Jackson2023-07-071-1/+1
| | | | | | | | | | | | | | Many of these call sites would panic if, somehow, the upper bound was zero. In most cases it is very complicated to see if whether this could happen. However, there is a better answer: Durations are (conceptually) dense, so picking the closed set (which includes its boundary) rather than the open one (which doesn't) will make little practical difference. So change four call sites to use `..=` instead of just `..`.
* 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
|
* arti-testing: remove some needless ::default()sNick Mathewson2023-05-111-4/+4
| | | | | | This fixes a warning from nightly clippy. I don't care for this warning, but fixing it is easier than adding a version-conditional warning exception.
* Convert blockers in arti-testing to TODOsIan Jackson2023-03-211-2/+2
| | | | I don't think these are that bad in testing code.
* 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.
* Upgrade to clap 3: replace deprecated functionsGabriel de Perthuis2022-11-041-61/+74
| | | | | | | | | | | Also replace Arg::takes_value with Arg::action to configure flags that don't take parameters vs options that do. This makes it easy to upgrade to clap 4. Tested deprecations with: cargo check --workspace --all-features --features clap/deprecated
* Upgrade to clap 3 with minimal changesGabriel de Perthuis2022-11-041-7/+5
| | | | | | | | This removes the last cargo audit override (for the unmaintained ansi_term). Don't mark options as required when they have default values: see <https://github.com/clap-rs/clap/pull/3793>.
* Run add_warnings.Nick Mathewson2022-11-031-0/+1
|
* tor-config: Replace dir detection with ConfigurationSource enumIan Jackson2022-08-251-2/+7
| | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/682#note_2830860 And subsequent IRC discussion. Having done the work as per review comments, I don't much like the result. It's quite un-ergonomiuc. If we can't have fs autodetection, I think syntactic autodetection within sources.rs would be nearly as nice. However, I seem to be outvoted. At least the externally visible functionality (of an arti binary, say) is reasonably ergonomic.
* Run maint/add_warning crates/*/src/{lib,main}.rsIan Jackson2022-06-231-0/+3
| | | | Update all lint blocks
* lints: Make lint blocks consistentIan Jackson2022-05-311-1/+2
| | | | The remaining consequences of running add_warning
* lints: arti-testing: Move some allows outside the auto blockIan Jackson2022-05-311-2/+3
|