| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
| |
This is perma-unstable: We'll use it to make an export tool,
but that's it.
|
| | |
|
| |
|
|
|
| |
This lets us guarantee that every bit sequence is a valid
Option<CountryCode>.
|
| |
|
|
|
| |
This change allows us to provide the parts of the DenseRangeMap
on the data segment.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This abolishes the NetDefn type, and turns DenseRangeDb into a map to
one or (optionally!) two types.
For the DBs we ship, which don't have asn information, this saves
about 2.5 MiB.
(It also probably saves a bit more, since the niche optimization
didn't apply to NetDefn as it existed before, since it tried
to distinguish Some(None,None) from None.)
|
| |
|
|
|
| |
This required correcting some errors in our previous
ersatz geoip databases.
|
| | |
|
| |
|
|
|
| |
This type is more space-efficient than RangeInclusiveMap
in the case where most ranges do not have gaps between them.
|
| |
|
|
|
|
|
|
|
| |
`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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
- [`once_cell::sync::OnceCell`] has been replaced by [`std::sync::OnceLock`],
removing the need for the `once_cell` dependency.
|
| |
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
cargo doc --locked --document-private-items --workspace --all-features
warning: unclosed HTML tag `CountryCode`
--> crates/tor-geoip/src/lib.rs:90:54
|
90 | /// We store these as NonZeroU8 so that an Option<CountryCode> only has to
| ^^^^^^^^^^^^^
|
= note: `#[warn(rustdoc::invalid_html_tags)]` on by default
|
| |\
| |
| |
| |
| | |
geoip: Enable the niche optimization for CountryCode.
See merge request tpo/core/arti!1384
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| | |
Since we're going to be using `Option<CountryCode>` all over, let's
save the extra byte.
Sadly this required std::mem::transmute(), which is unsafe, so maybe
we should think twice.
|
| | |
| |
| |
| | |
to be able to debug it, for instance.
|
| | |
| |
| |
| |
| |
| |
| | |
so that GeoipDb can be created from files including ASNs generated with
tor/scripts/maint/geoip/geoip-db-tool.
Closes #961
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- When the `geoip` feature flag of `tor-netdir` is enabled, perform
GeoIP lookups for all relays added to the directory and add the
resulting country code to the `Relay` struct.
- The GeoIP database is provided in a new
`PartialNetDir::new_with_geoip` constructor.
- A new trait was also added to `tor-linkspec`, `HasCountryCode`, to
enable getting this data out from other crates.
Part of onionmasq#47.
|
| |/ |
|
| |
|
|
| |
Closes #950.
|
| |
|
|
|
| |
Without this, the build fails with
cargo test --workspace --no-default-features --features=tokio,native-tls
|
| |\
| |
| |
| |
| | |
lints: Promote clippy::print_stderr and clippy::print_stdout
See merge request tpo/core/arti!1271
|
| | |
| |
| |
| |
| | |
I prepared 161b9844d against an earlier version of main without the
geoip crate. Run maint/add_warning again.
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| | |
(There are plenty of strings that convert into 2 bytes of UTF8
without being two ascii characters, and there are plenty of
sequences of two ascii characters that aren't printable.)
|
| |/
|
|
| |
We want to make sure that ?? is always None, never a CountryCode.
|
|
|
- This adds a new crate, `tor-geoip`, which can parse and perform
lookups in the GeoIP database C-tor already uses (generated by a
maintenance utility in the C-tor codebase).
- We embed a copy of C-tor's databases with the crate and use
`include_str!` to ship them with the binary, bloating its size
somewhat.
- This does, however, solve the problem of figuring out how to
distribute these.
- The plan is to gate this functionality behind a feature flag anyway,
so the cost should be nil unless explicitly opted into.
Part of tpo/core/onionmasq#47.
|