summaryrefslogtreecommitdiff
path: root/crates/tor-config/src/load.rs
Commit message (Collapse)AuthorAgeFilesLines
* 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: Do some semi-manuallyIan Jackson2022-12-121-1/+9
| | | | | | | 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.
* Merge branch 'refactor-anyhow-arti-crate' into 'main'Nick Mathewson2022-08-311-1/+1
|\ | | | | | | | | Remove `anyhow` from `tor-config` crate See merge request tpo/core/arti!707
| * Remove `anyhow` from `tor-config` crateArturo Marquez2022-08-281-1/+1
| |
* | tor-config: DisfavouredKey: Linkify DisplayIan Jackson2022-08-301-1/+1
| |
* | tor-config: DisfavouredKey: Widen applicability of .to_string()Ian Jackson2022-08-301-1/+1
| | | | | | | | And linkify it.
* | Add documentation note on `to_string()` usage for DisfavouredKey.Alexander Færøy2022-08-301-0/+2
|/
* Improve error from bad escapes in a toml config.Nick Mathewson2022-08-251-1/+7
| | | | | | | | | | | | | | | | | Whereas previously we would say: ``` target/debug/arti: error: invalid escape character in string: `Z` at line 9 column 14 in ../../.config/arti/arti.toml ``` we now say: ``` target/debug/arti: error: invalid escape character in string: `Z` at line 9 column 14 in ../../.config/arti/arti.toml (If you wanted to include a literal \ character, you need to escape it by writing two in a row: \\) ``` The implementation is a bit of a hack, I'm afraid, but I don't think it's all that bad. Closes #549.
* tor-config: Support tracking deprecated config keysIan Jackson2022-08-251-9/+68
|
* tor-config: Introduce ResolutionResultsIan Jackson2022-08-251-19/+41
| | | | This will allow us to handle new kinds of warnigns etc.
* tor-config: Rename UnrecognizedKey to DisfavouredKeyIan Jackson2022-08-251-18/+18
| | | | We're going to want the to use the same type for deprecated keys.
* fix nighly clippytrinity-1686a2022-07-231-1/+1
|
* tor-config: Don't format source error as part of error messageNick Mathewson2022-06-221-2/+2
| | | | This is one I missed earlier.
* Fix typosDimitris Apostolou2022-06-051-3/+3
|
* Merge branch 'tor-config-tests' into 'main'Nick Mathewson2022-05-311-0/+61
|\ | | | | | | | | Add a few coverage-based tests to tor-config. See merge request tpo/core/arti!540
| * Add a few coverage-based tests to tor-config.Nick Mathewson2022-05-311-0/+61
| | | | | | | | There's nothing major here, but it does fill in a few gaps.
* | Fix a link with nightly rustdocNick Mathewson2022-05-261-1/+1
|/
* tor-config: load: clippy: adopt two suggestionsIan Jackson2022-05-261-3/+2
| | | | We can have mem::take, hooray.
* tor-config: load: Add missing "not".Ian Jackson2022-05-261-1/+1
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/529#note_2807331
* tor-config: load: Make UnrecognizedKeys not pubIan Jackson2022-05-261-1/+1
| | | | | | | This was a slip. As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/529#note_2807330
* tor-config: load: Add reversed testIan Jackson2022-05-251-0/+3
|
* tor-config: Add duplicative doc comments as per reviewIan Jackson2022-05-251-1/+6
|
* tor-config: load: example: Document what it does and who might write itIan Jackson2022-05-251-0/+16
|
* tor-config: load: Add a newlineIan Jackson2022-05-251-0/+1
| | | | This makes the function a tiny bit clearer.
* tor-config: load: Write actual definition of the Resolvable traitIan Jackson2022-05-251-2/+18
| | | | | This is not a doc comment because we don't want it to be public: it must refer to private fields, etc.
* tor-config: load: Explain why not write out macro call n timesIan Jackson2022-05-251-0/+2
|
* tor-config: docs: add more docs about load, esp. traitsIan Jackson2022-05-251-0/+23
|
* tor-config: docs: add a lot of context and overview and xrefsIan Jackson2022-05-251-0/+16
|
* tor-config: load: Avoid destructuring assignmentIan Jackson2022-05-251-2/+2
| | | | Not available in our MSRV.
* tor-config: load: Intersection: add more commentaryIan Jackson2022-05-251-5/+48
|
* tor-config: load: Drop a needless call to .into_iter()Ian Jackson2022-05-251-1/+0
| | | | I think this is a leftover from a previous version of this expression.
* tor-config: load: Fix a misleading commentIan Jackson2022-05-251-1/+1
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/529#note_2807070
* tor-config: load: Rename shorter_letIan Jackson2022-05-251-2/+2
| | | | | Instead of the wrong "prefix_len". As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/529#note_2807068
* tor-config: load: DocsIan Jackson2022-05-251-2/+2
|
* tor-config: Typo fixes (as per review comments)Ian Jackson2022-05-251-4/+4
|
* tor-config: load: Introduce UnrecognizedKeys enumIan Jackson2022-05-251-23/+52
| | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/529#note_2807078 This is in fact much clearer than the Option.
* Run rustfmt following renamingIan Jackson2022-05-251-1/+2
| | | | Split into its own commit to avoid churn in the rename commits.
* tor-config: Rename resolve_return_unrecognized, ..._ignore_...Ian Jackson2022-05-251-4/+4
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/529#note_2807077
* tor-config: Rename "ignored" to "unrecognized" throughoutIan Jackson2022-05-251-44/+44
| | | | | As per review comments https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/529#note_2807076
* tor-config: Example for load moduleIan Jackson2022-05-241-0/+46
|
* tor-config: Tests for ignored config key handlingIan Jackson2022-05-241-0/+56
|
* tor-config: Track and (by default) warn on ignored config keysIan Jackson2022-05-241-6/+102
|
* tor-config: Tests for support functions for tracking ignored keysIan Jackson2022-05-241-0/+80
|
* tor-config: Support functions for tracking ignored config keysIan Jackson2022-05-241-0/+168
| | | | This turns out to need quite a complicated algorithm.
* Split TorClientConfig out of ArtiConfig, and Resolvable traitIan Jackson2022-05-241-0/+85
| | | | | | | | | | | | This gets rid of `#[serde(flatten)]` which prevents serde_ignored (and other kinds of introspection) from working properly. The price is now that the toplevel has to deal with two configuration objects. The Resolvable trait is overkill right now, but is going to do More Things in a moment. In particular, we need the impl on tuples, so that the whole config can be processed in one go.
* tor-config: Introduce Builder trait and ConfigReolveErrorIan Jackson2022-05-241-0/+29
We are going to need this for some generic code which is going to appear shortly. Having it produced by impl_standard_builder seems best. But that does mean being able to disable it, so extra stuff in the macro. Nothing uses this trait yet. ConfigResolveError is not used now either, but will be in a moment.