aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-linkspec/src/ls.rs
Commit message (Collapse)AuthorAgeFilesLines
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+1
| | | | | | | | | | | | 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.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* Some HasMemoryCost impls in tor-linkspecIan Jackson2024-10-021-2/+8
|
* tor_bytes: Rename new_truncated_for_test to new_incomplete_for_test (fmt)Ian Jackson2024-09-121-2/+8
|
* tor_bytes: Rename new_truncated_for_test to new_incomplete_for_testIan Jackson2024-09-121-6/+6
| | | | No semver implications since this wasn't in the last release.
* tor-bytes: Add a Reader constructor for use in testsIan Jackson2024-09-111-4/+4
| | | | | | | | | | | | 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.
* Change tor_bytes::Readable name to `b` in many placesIan Jackson2024-09-111-3/+3
| | | | | | | | | | | | | | | 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.
* Introduce and use tor_bytes::Error::new_truncated_for_testIan Jackson2024-09-101-6/+6
| | | | | | | | 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.
* tor-linkspec: reading tests: Use assert_eqIan Jackson2024-09-101-6/+6
| | | | | | | Error::Truncated is going to become more complicated, and anyway it would be nice to print the values if the test fails. Error is PartialEq now. (Maybe it wasn't when this was written?)
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* Change CircTarget::linkspecs() to return an encoded list.Nick Mathewson2023-05-101-0/+5
| | | | | | | | If we didn't do this, we would need to transfrom `EncodedLinkSpec`s into a `LinkSpec::Unrecognized`, which is not semantically right. What's more, every user of this API wants to consume encoded link specifiers, so encoding them early saves a little effort.
* linkspec: Make LinkSpecType public.Nick Mathewson2023-05-101-30/+38
| | | | | This lets us check the type of an `EncodedLinkSpec` as well, and lets us remove an interface that took a raw u8.
* linkspec: define conversion functions for EncodedLinkSpecNick Mathewson2023-05-101-48/+79
| | | | | | This commit adds functions to convert between LinkSpec and EncodedLinkSpec, and refactors their read/write implementations a bit to avoid code duplication.
* Rename UnparsedLinkSpec => EncodedLinkSpecNick Mathewson2023-05-101-12/+12
|
* tor-linkspec: Add a constructor for UnparsedLinkSpecNick Mathewson2023-03-061-0/+10
|
* tor-linkspec: New UnparsedLinkspec type.Nick Mathewson2023-02-171-0/+80
| | | | | | | | | | Unlike linkspec, this doesn't validate the actual contents of the specifiers. We'll use this so we can handle the linkspec list for an introduction point in an HsDesc, and just pass it on when constructing our circuits. I haven't added any accessor or constructor functions, because I don't expect to need them.
* tor-linkspec: LinkSpec parsing: use read_nested_u8len (fmt)Ian Jackson2023-02-061-13/+15
|
* tor-linkspec: LinkSpec parsing: use read_nested_u8lenIan Jackson2023-02-061-21/+5
| | | | This eliminates hardcoded length values.
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* test lint blocks: Add many many automaticallyIan Jackson2022-12-121-0/+8
| | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* Add a set of Identity-related types and accessors.Nick Mathewson2022-08-101-0/+10
| | | | | | | I wonder if these types are correct. I think it makes sense to have a Ref type like this, rather than just using `&RelayId`, but it doesn't seems that I can make `RelayId` and `RelayIdRef` implement Borrow and ToOwned for one another, so maybe I've messed up.
* tor-linkspec: Stop using infallible writers.Nick Mathewson2022-07-111-7/+10
|
* Convert each write_onto_infallible implementation into write_onto.Nick Mathewson2022-07-111-2/+3
|
* Rename "write" methods on tor-bytes to "write_infallible".Nick Mathewson2022-07-111-6/+6
| | | | | | | | | | | | | | | 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.
* Resolve the new `derive_partial_eq_without_eq` lint.Nick Mathewson2022-05-231-1/+1
| | | | It's a little overzealous sometimes, but it's mostly to the good.
* add semicolons if nothing returnedDaniel Eades2021-11-251-1/+1
|
* fix/silence clippy lints in test modulesDaniel Eades2021-09-081-0/+1
|
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+216
This will cause some pain for now, but now is really the best time to do this kind of thing.