| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| | |
|
| |
|
|
|
| |
This is not tested yet. It will be tested when we add round-trip
tests for votes.
|
| |
|
|
| |
This doesn't parse the keyword, only the value.
|
| |
|
|
|
|
|
|
|
| |
* Rename it so that it doesn't mention parse2, because we're going to
want to encode too.
* Remove the indirection: rename the one in md.rs to be the name
that's used in `with = `. (Previously, things were more complicated
so the extra layer of indirection was helpful.)
|
| | |
|
| |
|
|
|
|
|
| |
FixedB64 is the right type for these, when they are present.
This abolishes some ad-hoc boilerplate. Sadly we still need a bit of
that for Reasons.
|
| |
|
|
| |
This is router *status* not router *descriptor*.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This stabilises the parse2 and encode impls of consensus tyepe:
* {plain, md}::{Preamble, RouterStatus, RouterStatusIntroItem}
It also un-gates the parse2 and encode impls of some vote types.
* VoteAuthorityEntry - this type has been completed.
* RouterStatusMdDigestsVote - whole type still gated with ns-vote
Re the remaining vote types (vote::*): although each_variety.rs
doesn't have a cfg itself, there is a feature gate in the variety
macrology.
|
| | |
|
| |
|
|
| |
Now we only need one type.
|
| | |
|
| |
|
|
| |
Not sure how this is needed now, after rebase, but whatever.
|
| | |
|
| | |
|
| |
|
|
| |
This reverts commit 084ad9a716da8e44616a54fdfbba0140f5a7704e.
|
| |
|
|
|
| |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3139#note_3238496
|
| |
|
|
|
|
|
| |
These two files were largely identical.
Move the common text to per_species.rs, and fix a couple of imports so
that it still compiles.
|
| |
|
|
|
|
|
| |
Not having the flavour in the type name is a shame, but we probably
don't want to resort to generating the docs with macros.
Part of making these two files largely identical.
|
| |
|
|
| |
Part of making these two files largely identical.
|
| |
|
|
|
| |
Move the implementation to the trait method which then becomes
completely identical in both files.
|
| |
|
|
| |
Part of making ns.rs and md.rs largely identical.
|
| |
|
|
| |
Part of making these two files largely identical.
|
| |
|
|
|
|
|
| |
In the species-specific files ns.rs and md.rs, use the unqualified
name; re-export it with the new macro.
We are working towards making these two files largely identical.
|
| |
|
|
|
| |
This will let us deduplicate a fair amount of code, and also will let
us support votes as well as ns and md consensuses.
|
| |
|
|
| |
Cut-and-paste error, I think.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The warning `clippy::bool_to_int_with_if` is meant to shout at you
when you say `if x { 1 } else { 0 }` and instead suggest that you
say `inttype::from(x)`.
I agreed with this for the case in tor-cert, where we are literally
converting a boolean into a flag.
I don't agree with this in tor-netdoc, where we are using a boolean
to decide how many fields to skip in a given document format. So
for this case, I decided to clean up the code a little by renaming
"skip" to "n_skip", and changing the boolean to use an enum instead.
|
| | |
|
| |
|
|
|
| |
Remove all `use` statements for `TryFrom` and `TryInto`. These are
now redundant in Rust 2021.
|
| | |
|
| |
|
|
|
|
|
|
| |
This commit uses the `visibility` and `visible` crates to
conditionally make certain structs and their fields public
(respectively). This is incredibly dangerous to use for anything
besides testing, and I've tried to write the documentation for the
feature accordingly.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This error type doesn't impement HasKind, since the kind will depend
on context.
However, the existing implementation was pretty messy and inconsistent:
Some errors had positions, some didn't.
Some took messages as str, some as String.
Some had internal errors that were somewhat orthogonal to their actual
types.
This commit refactors tor_netdoc::Error to use a ParseErrorKind, and
adds a set of convenience functions to add positions and
messages to the errors that need them.
|
| |
|