| Commit message (Collapse) | Author | Age | Files | Lines |
| |\
| |
| |
| |
| |
| |
| | |
Removed unnecessary lint
Closes #2556
See merge request tpo/core/arti!4210
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
Removed unnecessary lint
|
| |\ \
| | |
| | |
| | |
| | | |
tor-linkspec: Use deftly to reduce copypasta in RelayId and RelayIdRef
See merge request tpo/core/arti!4196
|
| | | |
| | |
| | |
| | |
| | | |
Prompted by
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/4196#note_3433090
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
rustfmt likes this IMO-awful layout for derives.
We can force it to let us manually break the line, if we use //,
and then it stays put.
No functional change.
|
| | | |
| | |
| | |
| | | |
Pure whitespace change. Review with, eg, git diff -w.
|
| | | |
| | |
| | |
| | | |
This gets rid of the matcher, and the need to invoke it.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
Change $var to $vname, and $type to $IDENTITY.
These are the names used in the deftly template. This will make the
next commit almost a no-op.
|
| | | |
| | |
| | |
| | |
| | | |
We can just refer to the PartialEq<FooIdentity> for RelayIdRef, which
is macro-generated just above, replacing this copy-pasted matches.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
This removes quite a lot of in-detail copy-paste.
The lone `}` is being moved, bringing the code we're changing within
the scope of the template.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Derive the two types. We end up moving the display strings from
direct attributes directed to derive_more, to deftly attributes.
Indentation is rather odd now: we ought to indent the macro body.
We'll sort that out at the end.
No functional change.
|
| | |/
| |
| |
| |
| |
| |
| | |
Pure code motion. We want to move this to where a bigger macro is
going to be, so that it can be part of it.
Code motion only, review with --color-moved.
|
| |/ |
|
| |
|
|
| |
This eliminates some string slicing.
|
| |
|
|
|
|
|
|
| |
This commit adds #[allow(clippy::string_slice)] to all functions in the
code where string slices are used, alongside a TODO comment.
We do this add the function header to have it consistent, as things like
expression based allow's are still experimental.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This commit executes maint/add_warning with the just added change to
deny string slices except in tests.
I recommend auditing this by checking out the previous commit followed
by running the script yourself and then verifying that the diff is
identical to this commit.
This commit makes cargo clippy fail. We will add exceptions in the next
commit.
|
| |
|
|
|
|
|
|
| |
With this change, we will accept serialized RelayId representations
that omit one or more keys. This will eventually allow us to omit
absent keys when we serialize these.
This is the first stage of #2477.
|
| |
|
|
|
|
| |
Also set a better error message when validating channel target.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
| |
ChanTarget
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
| |
The has_all_reachable_addresses() should be used to validate the channel
target of a request to open a relay channel. The function looks for non
routable addresses or, most importantly, private addresses.
The other function is to validate that all socket addresses have a non
zero port.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Typos found with codespell
|
| | |
|
| |
|
|
|
|
|
|
|
| |
This is used when we build an OwnedChanTarget using the builder. Instead
of going identities by identities at the callsite, we can use this
helper to get us a RelayIds builder and set it in the
OwnedChanTargetBuilder.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
| |
This required to implement Display for PtTarget.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
`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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
During the channel handshake, we require the peer IP address for the
canonicity check which requires the exact peer IP we are connected to.
This commit adds a function that enforces this requirement on a
ChannelMethod so anything else results in an error.
It is to basically have stronger guarantee on the channel method we use
in the handshake.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
This adds the lint to all our crates.
|
| | |
|
| |
|
|
| |
This silences a new warning on nightly.
|
| |
|
|
| |
Run maint/add_warning
|
| | |
|
| |
|
|
|
|
|
|
| |
This will let us model the actual structure of routerstatus entries in
netdocs more closely. They don't have the addresses in a single list.
When this code was written this would have been much more awkward,
but now we have RPITIT.
|
| |
|
|
| |
This feature has been removed from nightly, in favor of doc_cfg.
|
| |
|
|
|
|
|
|
|
|
| |
This is important, since some circuits require us to negotiate a new
channel, and some don't: by adding this variability, we can easily
learn a timeout based on pre-existing channels to our guards, but
then later time out if it takes a while to open a TLS connection.
This is a possible solution to part of #2079, a bug where we "learn"
a circuit timeout that is too low for us to satisfy.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
See #2060.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Denies 'mod.rs' files for consistency.
https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
This warning shows up when running `cargo +nightly doc`.
Apparently nightly doesn't like it when we have elided a lifetime
that has a perfectly good name.
|
| | |
|
| | |
|
| |\
| |
| |
| |
| | |
tor-chanmgr: support multiple channels for a relay ID
See merge request tpo/core/arti!2442
|
| | |
| |
| |
| | |
Like `ByRelayIds`, but allows multiple items per relay ID.
|