<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/arti.git/crates/tor-netdoc/src/parse/parser.rs, branch arti-v1.4.2</title>
<subtitle>mirror of https://gitlab.torproject.org/tpo/core/arti
</subtitle>
<id>http://git.dilluti0n.com/mirrors/arti.git/atom?h=arti-v1.4.2</id>
<link rel='self' href='http://git.dilluti0n.com/mirrors/arti.git/atom?h=arti-v1.4.2'/>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/'/>
<updated>2025-03-17T16:55:57Z</updated>
<entry>
<title>netdoc: Make some parsing init functions fallible.</title>
<updated>2025-03-17T16:55:57Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2025-03-17T16:55:57Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=f85cc0c663518edbe1c09ae2c6928e6f52cae7bb'/>
<id>urn:sha1:f85cc0c663518edbe1c09ae2c6928e6f52cae7bb</id>
<content type='text'>
I'm about to make our parsers reject some strings at construction
time, so it makes sense to have these functions become fallible.

This is a breaking change.
</content>
</entry>
<entry>
<title>Run maint/add_warning.</title>
<updated>2024-03-13T16:30:53Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2024-03-13T16:30:53Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=c0c9bd15d42897825dd0ab3d3b8dd1c17bd6320c'/>
<id>urn:sha1:c0c9bd15d42897825dd0ab3d3b8dd1c17bd6320c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>clippy: Replace many calls to .get(0) with .first()</title>
<updated>2024-01-02T13:56:08Z</updated>
<author>
<name>Ian Jackson</name>
<email>ijackson@chiark.greenend.org.uk</email>
</author>
<published>2024-01-02T12:48:44Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=b9da8cf60618b16c021d3ecf1ec24e2dce56aff5'/>
<id>urn:sha1:b9da8cf60618b16c021d3ecf1ec24e2dce56aff5</id>
<content type='text'>
FTR I don't think agree with clippy on this question, but then I often
don't.
</content>
</entry>
<entry>
<title>Run maint/add_warning to add lint block everywhere</title>
<updated>2023-08-23T09:34:00Z</updated>
<author>
<name>Ian Jackson</name>
<email>ijackson@chiark.greenend.org.uk</email>
</author>
<published>2023-08-22T14:28:12Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=42df88d6bf6dbb460d2e5e1cd4838aafaffbe9ac'/>
<id>urn:sha1:42df88d6bf6dbb460d2e5e1cd4838aafaffbe9ac</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Run maint/add_warning to actually apply new lint allows</title>
<updated>2023-07-10T12:49:51Z</updated>
<author>
<name>Ian Jackson</name>
<email>ijackson@chiark.greenend.org.uk</email>
</author>
<published>2023-07-10T11:19:32Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=473447a82e099fd52a674c28f5bc24b3e05208c0'/>
<id>urn:sha1:473447a82e099fd52a674c28f5bc24b3e05208c0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>netdoc: Rename parse_error_kind() to netdoc_error_kind().</title>
<updated>2023-05-11T17:39:40Z</updated>
<author>
<name>Gabriela Moldovan</name>
<email>gabi@torproject.org</email>
</author>
<published>2023-05-11T17:39:40Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=04228933730a0727ea75e75770eda180191ff93a'/>
<id>urn:sha1:04228933730a0727ea75e75770eda180191ff93a</id>
<content type='text'>
`ParseErrorKind` was renamed to `NetdocErrorKind`, so we need to
rename this acccessor too.

Signed-off-by: Gabriela Moldovan &lt;gabi@torproject.org&gt;
</content>
</entry>
<entry>
<title>netdoc: Rename `ParseError{Kind, Source}` to `NetdocError{Kind, Source}`.</title>
<updated>2023-05-10T14:52:28Z</updated>
<author>
<name>Gabriela Moldovan</name>
<email>gabi@torproject.org</email>
</author>
<published>2023-05-10T14:40:57Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=099b2315b015b96cd8163a364f92810ea4982cfa'/>
<id>urn:sha1:099b2315b015b96cd8163a364f92810ea4982cfa</id>
<content type='text'>
`ParseErrorSource` was originally meant to represent a parsing error,
this enum has since gained some variants that aren't really parsing
related (`Signature`, `CertSignature`, `UntimelyDescriptor`).

Since this error type is now used for general-purpose netdoc errors,
let's rename `ParseError{Kind, Source}` to `NetdocError{Kind, Source}`.

Signed-off-by: Gabriela Moldovan &lt;gabi@torproject.org&gt;
</content>
</entry>
<entry>
<title>tor-netdoc: Remove many needless calls to .iter() and .into_iter()</title>
<updated>2023-02-15T17:17:01Z</updated>
<author>
<name>Ian Jackson</name>
<email>ijackson@chiark.greenend.org.uk</email>
</author>
<published>2023-02-15T16:18:53Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=4a91c732fe4b597ad4e90564ca4630ac3048938a'/>
<id>urn:sha1:4a91c732fe4b597ad4e90564ca4630ac3048938a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>tor-netdoc: Have sectionrules.parse take I, not &amp;mut I</title>
<updated>2023-02-15T17:16:57Z</updated>
<author>
<name>Ian Jackson</name>
<email>ijackson@chiark.greenend.org.uk</email>
</author>
<published>2023-02-15T16:14:15Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=7491424ee97412fcccb88ce8e4ae006874285cd9'/>
<id>urn:sha1:7491424ee97412fcccb88ce8e4ae006874285cd9</id>
<content type='text'>
There's a blanket impl of Itertor for &amp;mut impl Iterator, so this
isn't necessary, and it prevents us passing iterators by value
producing syntactic vinegar.
</content>
</entry>
<entry>
<title>netdoc: Require that unrecognized tokens be handled explicitly.</title>
<updated>2023-02-03T16:33:30Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2023-02-03T16:33:30Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=73199ebf68815f7bc1ef6f85f5ce04d3e2620a2e'/>
<id>urn:sha1:73199ebf68815f7bc1ef6f85f5ce04d3e2620a2e</id>
<content type='text'>
Now we require that, for all `SectionRules`, either the caller say
how to handle unrecognized tokens (using `.add(UNRECOGNIZED...)`),
or that they explicitly reject unrecognized tokens (using
`reject_unrecognized`()`.)

This solution uses an assert!() rather than an Error to indicate
failure.  I say that's fine, since
  1. This is a crate-internal API.
  2. We never dynamically construct SectionRules according to
     different behavior: they are always prefabricated in a fixed
     code block.  Thus, if we test a parser at all, we will make
     sure that its SectionRules are well-formed.

I considered and explicitly rejected a solution where the builder
had to be finalized with separate methods `build_strict()` or
`build_tolerant()`: It's too easy IMO for the caller to forget what
these call means.

Prevents further recurrences of #752.

Closes #752.
</content>
</entry>
</feed>
