| Commit message (Collapse) | Author | Age | Files | Lines |
| |\
| |
| |
| |
| | |
Add take_until_with_limit methods for better developer experience, modified error handling, changed take_until to use take_until_with_limit and added tests.
See merge request tpo/core/arti!4082
|
| | |
| |
| |
| |
| | |
These methods provide modified error handling,
changed take_until to use take_until_with_limit and added tests.
|
| | | |
|
| |/
|
|
| |
Removed unnecessary lint
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
`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.
|
| |
|
|
| |
Run maint/add_warning
|
| |
|
|
| |
This feature has been removed from nightly, in favor of doc_cfg.
|
| |
|
|
|
|
|
|
|
|
| |
The first sentence states that we have to reallocate and the
second one states that we "might" have to do so. Skip the
redundancy.
While at it, use the term "to zeroize" instead of introducing
"to zero", since the former is already used in a subsequent
sentence.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
| |
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 is part of an effort to make arti-rpc-client-core (and future
similar tools) able to use our very-low-level crates
without depending on things they don't need.
|
| |
|
|
|
| |
This variant is deprecated but it still ought to have a message so
long as it exists.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
Use "throws" terminology to avoid having to clutter the description
with Err(). Many of these doc comments contain otiose text such as
"returns Ok(()) on success" but let's not deal with that now.
|
| | |
|
| |
|
|
|
|
|
|
| |
And rename its variants and update the docs to contemplate wider use,
as suggested in #1620.
As discussed here
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2407#note_3075658
|
| |
|
|
|
| |
Apropos
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2407#note_3075638
|
| |
|
|
| |
No semver implications since this wasn't in the last release.
|
| |
|
|
|
| |
Prompted by
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2407#note_3075486
|
| |
|
|
|
| |
Prompted by
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2407#note_3075485
|
| |
|
|
|
| |
Prompted by
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2407#note_3075483
|
| |
|
|
| |
This was a leftover from before I invented Error::MissingData.
|
| | |
|
| |
|
|
|
| |
Fix semantic conflict of the suggested edit with the rename later in
the branch.
|
| |
|
|
|
| |
Suggestion from here
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2407#note_3075481
|
| |
|
|
|
|
|
|
|
| |
deprecated
Incomplete is a better name.
This lets us use Truncated for the old, deprecated, conflation of
"Incomplete" with what is now "MissingData".
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
This is item 1 from
https://gitlab.torproject.org/tpo/core/arti/-/issues/1614#note_3074562
and the alternative to item 2 presented in the 2nd half of
https://gitlab.torproject.org/tpo/core/arti/-/issues/1614#note_3074648
(Item 3 was done earlier, but now we change the behaviour.)
Fixes #1614.
|
| |
|
|
|
| |
Tidy up an error message. Now this can be on one line with variable
name interpolation.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We introduce the new constructor and call it at the error generation
sites. But there is still not yet any functional change.
Change the type of Truncated's field to be Sensitive.
The original reason for not doing this no longer applies, since we
don't generally want to open-code construction of this variant.
Conveniently, changing the type means we get to find all the sites
where one *is* constructed and adjust them.
In reader.rs and tor-proto we can just call incomplete_error.
In tor-cell, there's a call site where we previously provided an
underestimate, and where the Reader isn't available. We adjust that
ad-hoc but this is fine because the error variant will
change. (relaycell is using a Reader from from_slice.)
|
| |
|
|
|
|
|
| |
Here we add the constructor, and document it, and change the call
sites.
No functional change yet.
|
| |
|
|
| |
Some tests in other crates test this, but none in tor-bytes!
|
| |
|
|
|
|
|
|
|
|
|
|
| |
We could call from_possibly_incomplete_slice in these, but that's
confusing and distracting.
Here we add this constructor, and document it (in terms of the
constructor to come), and change the call sites.
No functional change. Doing this now will prevent unwanted changes to
test behaviours when we change the behaviour of Readers made by
Reader::from_slice.
|
| |
|
|
|
|
|
| |
I just perpetrated a bug by adding a variant to this which ended up
not PartialEq to itself. This open-coded match is a footgun.
No functional change.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The codebase uses `r` sometimes and `b` at other times.
Making this consistent makes widespread changes easier, and is
clearer for humans.
I think `b` is better than `r` because `r` might be "return".
It is indeed used that way in a couple of places in reader.rs, even.
I haven't changed *everywhere*, just Readable impls (where `r` is
particularly likely to be "return value") and occurrences in
tor-bytes.
No functional change.
|
| | |
|
| |
|
|
|
| |
Suggested in
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2390#note_3072975
|
| | |
|
| |
|
|
| |
This will allow us to fix #1592, but it doesn't do so yet.
|
| |
|
|
|
|
|
|
| |
This is going to want to do something more complicated (as described
in the docs).
In this commit we change all the tests that are expecting Truncated
errors. That reduces noise in the next commit.
|
| |
|
|
|
|
| |
This refers to the `deficit` field in Error::Truncated, which is going
to appear in a later commit. It seems kinder to my reviewer to add
this doc now early in the branch.
|
| |
|
|
|
| |
This removes one construction site of Error::Truncated. We are about
to make constructing one of those more fiddly.
|