| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
Use educe so that we don't derive T: Clone bound.
|
| |\
| |
| |
| |
| | |
tor-basic-utils: Improve docs for iter_join
See merge request tpo/core/arti!4213
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| |/ |
|
| | |
|
| | |
|
| |
|
|
| |
Removed unnecessary lint
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
This is no longer required due to Deref
|
| |
|
|
| |
We can do so now directly.
|
| |
|
|
| |
If we derive it, we get access to Arc<T>, which is okay.
|
| |
|
|
| |
If one really wants to circumvent the guarantees ...
|
| |
|
|
| |
As a shorthand for T::intern_cache().intern(value).
|
| | |
|
| | |
|
| |
|
|
|
|
| |
Adds a derive-deftly based macro so that interfacing code can derive
GloballyInternable on structs in order to save redundant and repetitive
implementation calls.
|
| |
|
|
| |
We will make use of it in the next commit.
|
| |
|
|
|
|
|
|
| |
This defines a trait called GloballyInternable with a single method
`.intern_cache()` returning a static reference to the globally available
cache.
The next commit will add a derive-deftly based macro for it.
|
| |
|
|
|
| |
This commit modifies the codebase to actually return Intern<T> in
InternCache<T> and adds calls to .into() accordingly.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This commit introduces a new type for use with InternCache<T>:
Intern<T>.
Right now, we have the problem that this cache returns a general Arc<T>,
which leads to the issue that we quickly loose overview from where
values originate. With this type, it becomes clearer from where they
come.
In the next commit, we will adjust InternCache and the remaining
codebase accordingly.
|
| |\
| |
| |
| |
| | |
Fix string_slice exceptions outside of netdoc
See merge request tpo/core/arti!4092
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| | |
I want to call this in one of tor-netdoc's parse2 derives, which *do*
support generics.
|
| | |
| |
| |
| |
| | |
If we move this let into the item impl, it will have access to the
generics we're about to add to the `impl $rule`.
|
| | |
| |
| |
| |
| |
| |
| | |
Previously we were relying on the macro_rules pattern being in the
rustdoc. But it's about to get more complex.
Document it manually.
|
| | |
| |
| |
| |
| | |
Usually Rust doesn't put a space after `:` in trait bounds. But it
does when calling a macro with { } syntax.
|
| | |
| |
| |
| |
| | |
This bit of the doc contains both succeeding and failing examples,
each marked with an appropriate comment.
|
| |/
|
|
|
|
|
| |
I want this in tor-netdoc (which doesn't use tor-config and probably
shouldn't).
Almost entirely code motion. Review with --color-moved.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
| |
We need this pattern in a lot of places; we might as well just
define it once.
|
| |
|
|
|
| |
It looks like we renamed this macro, but didn't rename it in its
documentation.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Fixes
warning: `rand::RngExt::random_range` does not refer to a reachable function
--> /volatile/rustcargo/Rustup/Arti/arti/clippy.toml:7:5
|
7 | { path = "rand::RngExt::random_range", reason = "Prefer tor_basic_utils::RngExt::gen_range_checked to avoid uncontrolled panics, or gen_range_infallible if applicable" },
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: add `allow-invalid = true` to the entry to suppress this warning
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
It is no longer needed since we require Rust 1.89. Nobody was using
it.
|
| |
|
|
| |
We now know when it was stabilized, so we can say when to use it.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
IoErrorExt existed to provide a workaround for Rust versions
that didn't have io::ErrorKind::NotADirectory. But NotADirectory
was stabilized in 1.83 and our MSRV is 1.89.
BinaryHeapExt existed to provide an implementation for Rust
versions that didn't have BinaryHeap::retain. But
BinaryHeap::retain was stabilized in 1.70 and our MSRV is 1.70.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Closes #2418.
Fixes TROVE-2026-005, where we would use a less cryptographically
secure (and probably less DoS resistant) hash function for these
tables if:
- We are built alongside another crate that uses `weak-table`
- That crate enables the `weak-table/ahash` feature.
- We are running on a system without hardware AES.
Severity: Low
|
| | |
|