| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Otherwise deriving NetdocEncodable doesn't work outside this crate.
|
| |
|
|
|
|
|
|
|
|
|
| |
With the introduction of the derives for document encoding, we now
have a trait ItemObjectEncodable. We will want a method on
ItemEncoder that takes an ItemObjectEncodable, and that should be
called `object` since it's a better approach than working ad-hoc with
tor_bytes::Writeable. (For example, an ItemObjectEncodable knows its
own label.)
So, rename `object` to `object_bytes`.
|
| | |
|
| | |
|
| |
|
|
|
| |
Signature encoding is not yet supported. We need to consider how this
will work.
|
| |
|
|
|
|
|
|
| |
This is quite like the one for parse2, but separate for Reasons.
Also add a bit of explanation to parse2's multiplicity.rs, about why
there are all these different FooSetMethods traits, which the encoder
doesn't need.
|
| |
|
|
| |
And implement them for Void and tuples, as applicable.
|
| |
|
|
|
| |
Adding these all at the beginning helped me with churn in this branch.
The allow(unused) will go away again shortly.
|
| |
|
|
|
| |
This provides a way to explicitly consume the encoder and finish the
item, without use of mem::drop.
|
| |
|
|
|
|
|
|
| |
The new derive is going to want this. So it would need to be at least
`#[doc(hidden)]`. But it makes sense to expose it.
But, it had a weird signature. Make its signature like that of `.arg_empty()`.
(Note that an ItemEncoder contains just a `&mut NetdocEncoder`.)
|
| | |
|
| |
|
|
|
| |
talking about the "keyword argument syntax" makes it sound a bit like
its' the *keyword* that is wrong.
|
| |
|
|
|
|
|
|
|
| |
NormalItemArgument is for types where we use the Display as the netdoc
argument formatter. But what if gives the empty string?
Previously we would allow `add_arg` to handle the error. That would
record it in the NetdocEncoder. That's kind of OK, but it will
prevent the caller from aborting early (and from elaborating the error).
|
| | |
|
| |
|
|
|
|
|
| |
tor_bytes also has a write_onto method. And types (especially utility
types like `Ignored`) might conceivably implement both!
No need for semver update since this was pub(crate) in the previous release.
|
| | |
|
| |
|
|
|
| |
clippy points out that if argument-less `new` can exist, so should
Default.
|
| |
|
|
|
| |
My planned new derive for encoding will be pub, but cfg gated, like
parse2 is.
|
| | |
|
| |
|
|
|
| |
My planned encoding derive macro is not going to use `decl_keyword!`
but will need to call `NetdocEncoder::item`.
|
|
|
The word "build" so often in Rust means builder pattern. This module
contains functions for encoding.
|