| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
Involves lots of code motion. Review with --color-moved.
|
| |
|
|
| |
I discovered this didn't work, when I tried to use it.
|
| |
|
|
|
|
|
|
| |
Add a new testdata_live module which is exposed with the testing
features, containing the testdata-live in string constants.
This avoids the need for test cases in other crates to walk the
filesystem to an area outside their own crate path.
|
| | |
|
| | |
|
| |
|
|
| |
Removed unnecessary lint
|
| |
|
|
| |
This will be used for exit port summary calculations.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3985#note_3413182
I left the word "fixed" in some of the docs and error messages, where
it seemed to make sense.
|
| |
|
|
| |
We're going to want quite a lot of this for eg network-status-version.
|
| |
|
|
|
|
|
|
|
|
|
| |
This allows implementing NormalItemArgument for types that can only be
parsed, or only displayed - or other combinations.
I noticed this restriction while inventing a type I later decided was
unnecessary. I still think it's a good change.
There is no practical impact elsewhere, since in practice downstream
code implements NormalItemArgument rather than relying on it.
|
| |
|
|
| |
Everything that this needs is un-gated now.
|
| |
|
|
|
| |
This is only used for hsdescs right now. But it doesn't need to be
gated behind encode.
|
| | |
|
| |
|
|
| |
We're going to want this for sets of netdoc signature hashes.
|
| |
|
|
|
|
|
|
|
| |
`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.
|
| |
|
|
| |
This adds the lint to all our crates.
|
| | |
|
| |
|
|
|
|
|
| |
Make this whole module conditional on the encode feature.
Apply the derives. Provide the necessary manual implementations for
the types where we use `with`.
|
| | |
|
| |
|
|
| |
Now we use all the imports. We're still adding much code, though.
|
| |
|
|
|
| |
Adding these all at the beginning helped me with churn in this branch.
The allow(unused) will go away again shortly.
|
| |
|
|
|
|
|
| |
We're going to use this for the encoder testing too, so it needs to be
not buried inside parse2.
This commit is the file rename plus minimal changes to make it compile.
|
| |
|
|
|
| |
My planned new derive for encoding will be pub, but cfg gated, like
parse2 is.
|
| |
|
|
|
|
|
|
|
|
| |
My planned encoding derive macro is going to provide keywords as
literal strings.
(The purpose of this trait is to allow the old parser to be generic
over its keyword constants, not to provide type-safety against passing
non-keyword strings to document encoders. Such bugs aren't very
likely and will be especially unlikely when we're deriving encoders.)
|
| |
|
|
|
| |
My planned encoding derive macro is not going to use `decl_keyword!`
but will need to call `NetdocEncoder::item`.
|
| |
|
|
|
|
|
| |
We're going to introduce facilities for encoding more generally, and
we'll want a way to enable them.
Instead, have a separate feature for *encoding* documents.
|
| |
|
|
|
| |
The word "build" so often in Rust means builder pattern. This module
contains functions for encoding.
|
| |
|
|
| |
Run maint/add_warning
|
| |
|
|
|
|
| |
Since 9ce85acb3ab0d1a0b1be6ef0f10707983f4362a3
tor-netdoc: replace impl_item_argument_as_display with NormalItemArgument
this trait impl has implications for encoding as well as parsing.
|
| |
|
|
|
| |
This is currently used to enable `parse2::ItemArgumentParseable`.
In a moment it will enable `build::ItemArgument` too.
|
| |
|
|
| |
This feature has been removed from nightly, in favor of doc_cfg.
|
| |
|
|
|
| |
This is needed if we want to use these macros in `doc`, which we're
going to.
|
| |
|
|
|
| |
This isn't used anywhere yet. We're going to demonstrate it, and test
the demo, in a moment.
|
| |
|
|
| |
See #2060.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Part of #1849.
Note that these functions are distributed across crates,
so that if (in the future) we stop doing API breaks
with every release, we will get the right outputs.
Note also that these functions build the list of protocols
out of specific symbolic features, rather than numbers:
this makes it easier to avoid errors about "which feature was
Relay=4 again", and easier to avoid accidentally referring to a
protocol that doesn't exist, like "Consensus" (should be "Cons")
or "HsDir" (case is wrong).
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
Now
cargo check --workspace --no-default-features --all-targets
cargo build -p arti --no-default-features --features=memquota,tokio,native-tls
are both clean.
|
| |
|
|
| |
This commit is automatically generated.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Closes #950.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
`ParseErrorSource` was originally meant to represent a parsing error,
this enum has since gained some variants that aren't really parsing
related (`Signature`, `CertSignature`, `UntimelyDescriptor`).
Since this error type is now used for general-purpose netdoc errors,
let's rename `ParseError{Kind, Source}` to `NetdocError{Kind, Source}`.
Signed-off-by: Gabriela Moldovan <[email protected]>
|
| |
|
|
|
|
|
|
| |
`NetdocText` is a wrapper around a `String` and a type marker. The type
annotation proved of limited use, and made the netdoc builder API
somewhat awkward to use.
Signed-off-by: Gabriela Moldovan <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This introduces the `NetdocBuilder` trait described in
`netdoc-builder.md` and a new `tor-netdoc::doc::hsdesc::build` module,
which exports the `HsDescBuilder`. Hidden services will use
`HsDescBuilder` to build and encode hidden service descriptors.
There are several TODOs in the code that I'm planning to address
separately.
Partially addresses #745.
Signed-off-by: Gabriela Moldovan <[email protected]>
|