Nick Mathewson
a6dd92843e
Allow clippy::unchecked_duration_subtraction in tests
...
This panics on error, and we're fine with a panic on misbehavior in
tests.
2023-01-27 08:28:02 -05:00
Nick Mathewson
bf04641c68
Disable clippy::unlinlined-format-args
...
This warning kind of snuck up on us! (See #748 ) For now, let's
disable it. (I've cleaned it up in a couple of examples, since
those are meant to be more idiomatic and user-facing.)
Closes #748 .
2023-01-27 08:27:47 -05:00
Ian Jackson
043581fe0e
tor-bytes: impl Writeable for &impl Writeable
2023-01-24 16:15:17 +00:00
Ian Jackson
a4a4b19f21
tor-bytes: Implement conversion from EncodeError to Bug
2023-01-24 16:15:17 +00:00
Ian Jackson
4e6f5b7ff3
Do not .gitignore crates/*/fuzz/corpus
...
These are symlinks which are actually checked in. They should not be
ignored. (This caused trouble for some of my privsep tooling...)
2023-01-20 17:29:00 +00:00
eta
118050e54c
Merge branch 'test-lints' into 'main'
...
Add test lint blocks to all "mod test"
See merge request tpo/core/arti!937
2023-01-06 17:16:09 +00:00
Emil Engler
8579bc66a8
doc: consistent summary line for the READMEs
...
This commit introduces a consistency to the summary line of all
README.md files in each and every crate.
2022-12-20 14:31:47 +01:00
Ian Jackson
125a455bdc
test lint blocks: Add many many automatically
...
This is precisely the result of running the rune in
maint/adhoc-add-lint-blocks.
2022-12-12 18:00:30 +00:00
Nick Mathewson
38bef96b99
Bump the minor version of every crate.
...
We made this job easy this time around: by incrementing our MSRV, we
have forced ourselves to do at least a minor bump everywhere.
2022-11-30 15:10:16 -05:00
Nick Mathewson
936920b26e
bump rust-version to 1.60 in every crate.
2022-11-10 10:57:33 -05:00
Nick Mathewson
932fe48eaf
Run add_warnings.
2022-11-03 11:06:02 -04:00
trinity-1686a
d29f38603d
set all crate edition to 2021
2022-11-01 00:17:33 +01:00
Emil Engler
362d822ee4
tor-bytes: Avoid redundant allocation
...
See c489e1d911
2022-10-25 16:24:42 +02:00
Nick Mathewson
8f267ba166
Fix some rustdoc errors.
...
In addition to the usual "You named that method wrong!" errors, we
have a new rustdoc error that complains about bogus "HTML tags" that
are actually unquoted usage of types like `Result<Foo>`.
2022-10-13 09:08:46 -04:00
Ian Jackson
f84d8777db
cargo fmt to remove blank lines
...
Apparently cargo fmt doesn't like these, which my perl rune didn't
delete.
This commit is precisely the result of `cargo fmt`.
2022-10-12 15:29:04 +01:00
Ian Jackson
d9910dba08
Replace all README copies in src/lib.rs with includes
...
The feature we want is `#[doc = include_str!("README.md")]`, which is
stable since 1.54 and our MSRV is now 1.56.
This commit is precisely the result of the following Perl rune:
perl -i~ -0777 -pe 's{(^//!(?!.*\@\@).*\n)+}{#![doc = include_str!("../README.md")]\n}m' crates/*/src/lib.rs
2022-10-12 15:29:03 +01:00
Nick Mathewson
128fb76c73
Upgrade all fuzzers to newer libfuzzer-sys version.
2022-10-03 14:35:34 -04:00
Nick Mathewson
388e0cbab5
Bump crates that have had backward compatible API changes.
2022-10-03 09:52:34 -04:00
Nick Mathewson
a5f704f443
Remove semver.md from arti-1.0.0
2022-09-07 09:17:00 -04:00
Nick Mathewson
96875ea208
Bump crate versions in preparation for Arti 1.0.0 release.
...
Because we want to work more on ensuring that our semver stability
story is solid, we are _not_ bumping arti-client to 1.0.0 right now.
Here are the bumps we _are_ doing. Crates with "minor" bumps have
had API breaks; crates with "patch" bumps have had new APIs added.
Note that `tor-congestion` is not bumped here: it's a new crate, and
hasn't been published before.
```
tor-basic-utils minor
fs-mistrust minor
tor-config minor
tor-rtcompat minor
tor-rtmock minor
tor-llcrypto patch
tor-bytes patch
tor-linkspec minor
tor-cell minor
tor-proto minor
tor-netdoc patch
tor-netdir minor
tor-persist patch
tor-chanmgr minor
tor-guardmgr minor
tor-circmgr minor
tor-dirmgr minor
arti-client minor
arti-hyper minor
arti major
arti-bench minor
arti-testing minor
```
2022-09-01 08:59:49 -04:00
trinity-1686a
7f939fa480
enable doc_auto_cfg feature on every crate when documenting for docs.rs
2022-08-24 18:22:41 +02:00
Nick Mathewson
f1c6447403
New SecretBuf type in tor-bytes
...
This Writer is a simple wrapper around `Vec<u8>` that makes sure
that its contents are cleared whenever they are dropped _or
reallocated_.
The reallocation is the important part here: without that, we risk
not zeroizing the first allocation of the buffer.
2022-08-01 15:41:22 -04:00
Nick Mathewson
b16c042004
Now that versions have bumped, remove semver.md files.
2022-08-01 10:07:12 -04:00
Nick Mathewson
859ae4acd0
Bump patch versions on crates that have new APIs.
...
Do _not_ bump the dependency versions on crates that have had no
changes since arti 0.0.5, since those crates do not depend on the
new APIs.
```
cargo set-version -p tor-basic-utils --bump patch
cargo set-version -p tor-llcrypto --bump patch
git restore crates/tor-checkable
git restore crates/tor-consdiff
git restore crates/tor-rtmock
```
2022-08-01 09:56:29 -04:00
Nick Mathewson
f5dcb98f06
Bump minor versions on all crates that have had breaking changes.
...
Done with these commands:
```
cargo set-version -p fs-mistrust --bump minor
cargo set-version -p tor-bytes --bump minor
cargo set-version -p tor-socksproto --bump minor
cargo set-version -p tor-cert --bump minor
cargo set-version -p tor-linkspec --bump minor
cargo set-version -p tor-cell --bump minor
cargo set-version -p tor-netdir --bump minor
cargo set-version -p tor-persist --bump minor
cargo set-version -p tor-chanmgr --bump minor
cargo set-version -p tor-guardmgr --bump minor
cargo set-version -p tor-circmgr --bump minor
cargo set-version -p tor-dirclient --bump minor
cargo set-version -p tor-dirmgr --bump minor
cargo set-version -p arti-client --bump minor
cargo set-version -p arti --bump minor
```
2022-08-01 09:43:09 -04:00
eta
d6b0116b71
Apply 1 suggestion(s) to 1 file(s)
2022-07-19 19:33:15 +00:00
Nick Mathewson
4dce7557b6
Remove the last vestiges of write_infallible.
...
Now that everything has been converted to fallible writers, we get
to finally remove write_infallible() from tor_bytes.
2022-07-11 11:18:51 -04:00
Nick Mathewson
9b02cf004c
tor-bytes::impls: Remove usage of infallible writers.
2022-07-11 11:18:51 -04:00
Nick Mathewson
5a61a6d73a
Remove "write_and_consume_infallible".
...
There were only a few of these. Removing it required porting
everything to use `write_and_consume` instead, and handling its
(potential) errors.
2022-07-11 11:18:51 -04:00
Nick Mathewson
8810af7f65
Convert each write_onto_infallible implementation into write_onto.
2022-07-11 11:18:51 -04:00
Nick Mathewson
e1337bee8f
Convert each write_into_infallible implementation into write_into.
...
(There was only one.)
2022-07-11 11:18:51 -04:00
Nick Mathewson
26c81edeea
Define new write_into and write_onto methods with correct APIs.
2022-07-11 11:18:51 -04:00
Nick Mathewson
7938f65c66
Rename "write" methods on tor-bytes to "write_infallible".
...
This comprises four renames:
```
write_onto -> write_onto_infallible
write_into -> write_into_infallible
write -> write_infallible
writer_and_consume -> write_and_consume_infallible.
```
The rest of this branch will be concerned with replacing these
`_infallible` methods with ones that return a `Result`. This is
part of #513 .
2022-07-11 11:18:51 -04:00
Nick Mathewson
fa72365f0e
Add a Bug variant to tor-bytes::EncodeError.
...
This will help down the line as we make more writers fallible.
2022-07-11 11:18:51 -04:00
Nick Mathewson
1dda69af2b
Remove semver.md files now that 0.5.0 is out
2022-06-24 13:31:38 -04:00
Nick Mathewson
20435aea75
Bump crate and dependency versions.
...
These were done with the following commands:
```
cargo set-version -p tor-basic-utils --bump patch
cargo set-version -p fs-mistrust --bump minor
cargo set-version -p tor-error --bump patch
cargo set-version -p tor-config --bump patch
cargo set-version -p tor-units --bump patch
cargo set-version -p tor-rtcompat --bump minor
cargo set-version -p tor-llcrypto --bump patch
cargo set-version -p tor-bytes --bump minor
cargo set-version -p tor-socksproto --bump minor
cargo set-version -p tor-cert --bump minor
cargo set-version -p tor-cell --bump minor
cargo set-version -p tor-proto --bump minor
cargo set-version -p tor-netdoc --bump patch
cargo set-version -p tor-netdir --bump minor
cargo set-version -p tor-persist --bump patch
cargo set-version -p tor-chanmgr --bump minor
cargo set-version -p tor-guardmgr --bump minor
cargo set-version -p tor-circmgr --bump patch
cargo set-version -p tor-dirclient --bump patch
cargo set-version -p tor-dirmgr --bump minor
cargo set-version -p arti-client --bump patch
cargo set-version -p arti --bump minor
cargo set-version -p arti-bench --bump minor
cargo set-version -p arti-testing --bump minor
```
2022-06-24 12:00:22 -04:00
Ian Jackson
4831f9d38c
Merge branch 'clippy' into 'main'
...
Fix clippy nightly again
See merge request tpo/core/arti!603
2022-06-24 14:13:58 +00:00
Ian Jackson
589c6e52bb
Run maint/add_warning crates/*/src/{lib,main}.rs
...
Update all lint blocks
2022-06-23 19:15:42 +01:00
Nick Mathewson
f699988c41
tor-bytes: Split EncodeError from Error
...
Since there is currently only one error type that can occur when
encoding, it doesn't make sense to use the full Error type here.
This split will help us downstream, as we no longer need to
categorize tor_bytes::Error as "an error in encoding or decoding".
I considered renaming Error to DecodeError, but that had pretty huge
downstream effects, and didn't seem to be worth it.
2022-06-23 08:58:25 -04:00
Nick Mathewson
c3da82fc2d
tor-cell: error usefulness and style fixes
2022-06-22 10:02:42 -04:00
Nick Mathewson
3120f1092a
Style fixes to tor-bytes errors.
...
Also note an issue with the design of tor-bytes::Error that should
probably go in a separate MR.
2022-06-22 09:00:59 -04:00
Ian Jackson
03a19f3877
tor-bytes: read_nested_*: rustfmt
...
I disagree with almost all of these layout decisions...
2022-06-10 12:30:22 +01:00
Ian Jackson
8fe63b3192
tor-bytes: read_nested_*: Take a closure
...
This eliminates the possibility of writing the bug of failing to call
`should_be_exhausted`.
As per this discussion
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/572#note_2811464
Fixes #498
2022-06-10 12:27:00 +01:00
Nick Mathewson
a2c6bd08fe
Fix typos in docs and comments
2022-06-09 17:08:56 +01:00
Ian Jackson
6f92bf9e86
tor-bytes: Provide nested writers
2022-06-09 17:08:56 +01:00
Ian Jackson
a6a48c3c28
tor-bytes: Provide nested readers
2022-06-09 17:08:56 +01:00
Ian Jackson
04bca2e75a
tor-bytes: Reader: Provide take_rest
...
We'll want this in a moment.
2022-06-09 17:08:56 +01:00
Ian Jackson
655804f804
tor-bytes: Prepare errors for nested reader/writer
...
Writing is going to be able to give errors too.
2022-06-09 17:08:56 +01:00
Ian Jackson
4f42101554
lints: Add let_unit_value allow to all crates
...
From running add_warning, with manual picking of the right
hunks/lines.
2022-05-31 15:23:52 +01:00
Ian Jackson
ba0843da4a
lints: Add lint block delimiters to every crate
...
This was the result of:
maint/add_warning crates/*/src/{lib,main}.rs
and then manually curating the results.
2022-05-31 13:00:31 +01:00