Nick Mathewson
592d6bf8a3
Bump the patch version of each crate with _trivial_ changes.
...
These crates have not had changes to their behavior; as such it is
not necessary to bump their dependencies to require the new versions.
2023-02-01 10:10:36 -05:00
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
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
Ian Jackson
baf78361e8
test lint blocks: Do some semi-manually
...
This is the hunks from running the rune in maint/adhoc-add-lint-blocks
but which require some subsequent manual fixup: usually, deleting
now-superfluous outer allows, but in some cases manually putting back
lints that the adhoc script deleted.
2022-12-12 18:00:29 +00:00
Nick Mathewson
e0aeda3071
Remove semver.md files now that 1.1.0 is released.
2022-11-30 17:10:29 -05: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
Ian Jackson
c82cda85d6
tor-basic-utils: DropNotifyWatchSender: use DropNotifyEofSignallable
...
This will help avoid the programmer making the mistake I made here:
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/852#note_2854029
2022-11-23 17:50:05 +00:00
Ian Jackson
63a799a118
tor-basic-utils: DropNotifyWatchSender test: introduce I
...
We do want to test this with a non-Option type, but we are going to
have to wrap it up.
2022-11-23 17:50:01 +00:00
Ian Jackson
91536da10a
tor-basic-utils: Provide helper for serde flexible parsing
2022-11-21 14:58:24 +00:00
Nick Mathewson
936920b26e
bump rust-version to 1.60 in every crate.
2022-11-10 10:57:33 -05:00
Ian Jackson
f50da3efa1
define_accessor_trait: Allow specification of other items
2022-11-03 15:43:41 +00:00
Ian Jackson
64de9f74be
define_accessor_trait: Allow specification of supertraits
2022-11-03 15:43:41 +00:00
Nick Mathewson
932fe48eaf
Run add_warnings.
2022-11-03 11:06:02 -04:00
Ian Jackson
48f48841e1
Require derive_more 0.99.3
...
0.99.[012] have a bug https://github.com/JelteF/derive_more/issues/114
which makes the Deref derive for bridgedesc::StateGuard not work
and therefore breaks minimal-versions CI.
It seems simpler to require the newer version everywhere.
2022-11-03 11:37:23 +00:00
Ian Jackson
9796d615f8
tor-basic-utils: Provide an implementation of BinaryHeap::retain
...
This is currently nightly-only and is blocked on an unresolved API
question:
https://github.com/rust-lang/rust/issues/71503
2022-10-27 10:46:03 +01:00
Nick Mathewson
15ac14a5d9
n_key_set: clean up some wide lines
2022-10-24 08:08:56 -04:00
Nick Mathewson
ef1c0cd282
n_key_set: Re-insert by_foo_mut() accessors, but make them unsafe.
2022-10-24 08:04:02 -04:00
Nick Mathewson
d648446201
Fix some litter in a doc comment.
2022-10-24 07:59:42 -04:00
Nick Mathewson
24e62d3197
n_key_set: Add ability to modify entries in the map.
...
The keys can change: if they do, then the entry is removed from its
previous position and inserted at the new one, possibly displacing
others.
2022-10-24 07:58:45 -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
Ian Jackson
82ad9eea5f
Allow "clippy::single_char_pattern" in tests.
...
This lint exists for perf reasons, and this is rarely relevant in
tests.
Using double quoted str is generally cognitively less burdensome.
2022-10-12 13:50:29 +01:00
Nick Mathewson
5a5f96aa37
n_key_set: Fix bugs in API documentation.
...
For whatever reason, rustdoc didn't like these multiline strings
in `doc` attributes.
2022-10-04 16:05:40 -04:00
Nick Mathewson
f8382d4978
n_key_set: Wrap "where" clauses in square brackets too.
...
Otherwise, there is a parsing ambiguity. :(
2022-10-04 16:05:40 -04:00
Nick Mathewson
8475d3ab39
n_key_set: Rename generic parameters on functions.
...
Previously we used `<T>` in a bunch of places. But that fails
if you try to declare `T` as a parameter on the structure itself.
2022-10-04 16:05:40 -04:00
Nick Mathewson
bf7c0bb2ba
n_key_set: Add a try_insert().
...
I am finding as I use this that I want a variant that can't panic.
2022-10-04 16:05:40 -04:00
Nick Mathewson
7402578af4
Merge branch 'multi_keyed_set' into 'main'
...
Include a HashSet variant that can be keyed on multiple keys.
See merge request tpo/core/arti!747
2022-10-03 18:16:10 +00:00
Nick Mathewson
1329f2c8f3
n_key_set: fix doctest compilation.
2022-10-03 13:31:03 -04:00
Nick Mathewson
8ab2a88923
n_key_set: Update generic syntax
...
Doing this lets us work with defaults and const generics.
2022-10-03 13:31:01 -04:00
Nick Mathewson
857272bc7a
n_key_set: rename map elements.
...
This prevents an explosion if somebody has a key called "values".
2022-10-03 13:31:01 -04:00
Nick Mathewson
9c08fdb865
n_key_set: Add support for generic lifetimes.
...
It doesn't work for const generics yet, since they can't be repeated
in quite the same way.
2022-10-03 13:31:01 -04:00
Nick Mathewson
48a15d5627
Tweaks and improvements in documentation.
...
Most of these were suggested by Ian
2022-10-03 13:31:01 -04:00
Nick Mathewson
4724639d7c
Require slab 0.4.4
...
The `try_remove()` method, which we need, was introduced there.
2022-10-03 13:31:01 -04:00
Nick Mathewson
59f1f7c11d
Repair rustdoc.
...
The previous indentation was making it think that we had rust code
where none existed.
2022-10-03 13:31:01 -04:00
Nick Mathewson
9fd072a4d4
n_key_set: Add a function to check invariant violations
...
Also, document another invariant.
2022-10-03 13:31:01 -04:00
Nick Mathewson
0dc1573268
n_key_set: Use remove_by_foo to implement insert.
2022-10-03 13:31:01 -04:00
Nick Mathewson
e06ae79009
n_key_set: Panic on more invariant and constraint violations.
2022-10-03 13:31:01 -04:00
Nick Mathewson
43fd594819
n_key_set: Remove by_$key_mut.
...
This can't be used in a consistency-preserving way.
2022-10-03 13:31:01 -04:00
Nick Mathewson
7043df0241
n_key_set: Add flags to keys rather than inferring from Option<T>
...
Using Option<T> as an alias for T was too clever indeed, and it
meant that our HashMaps were declared with the wrong types.
Putting flags here instead gives us an extension point that we can
use in the future.
2022-10-03 13:31:01 -04:00
Nick Mathewson
f0d74db38e
n_key_set: Use to_owned to permit &str accessors.
2022-10-03 13:31:01 -04:00
Nick Mathewson
47c9ae0e4b
n_key_set: Add some tests, and notes on infelicities.
2022-10-03 13:31:01 -04:00
Nick Mathewson
4e3a390c5b
n_key_set: Fix a bug in function access.
2022-10-03 13:31:01 -04:00
Nick Mathewson
0321912ad0
n_key_set: add FromIterator.
2022-10-03 13:30:54 -04:00
Nick Mathewson
c2d4b4ed3b
Include a HashSet variant that can be keyed on multiple keys.
...
Every element in the set has up to N keys, each of which may have differnt
types. No value for any key may correspond to more than one element in
the set.
These properties can be provided, via a macro, for values of N between 1
and $BIG_ENOUGH.
We'll use this to implement a type that holds HasRelayIds.
2022-10-03 13:30:37 -04:00
Nick Mathewson
f5389b53e9
Bump crates that have had no API changes.
2022-10-03 09:47:09 -04:00
trinity-1686a
8e7a904260
fix clippy::needless_borrow
2022-09-10 14:39:47 +02:00
Nick Mathewson
a5f704f443
Remove semver.md from arti-1.0.0
2022-09-07 09:17:00 -04:00