Commit Graph
21 Commits
Author SHA1 Message Date
HugoandGitHub 642331fdab Upgrade required Rust version to 1.67. (#221)
This commit upgrades the minimum required Rust version to 1.67
and applies a Clippy-suggested fix.
2023-08-23 11:41:42 +02:00
Martin HoffmannandGitHub a2ce078a92 The Great octseq Conversion (#160)
This commit swaps the traits and types defined in `base::octets` for their
equivalent in the `octseq` trait. These are mostly the same except that they
facilitate Generic Associated Types as stabilized in Rust 1.65. This results
in subtly changed trait bounds, though mostly these should be invisible to
the user.

One notable change is that `octseq` makes the error type of the
`OctetsBuilder` generic and uses `Infallible` for those types where
appending data will never fail (which, for most users, is all of them). It
provides methods for either case and we are mirroring these in `domain`.
While this means that converting you code to using the PR will require some
work, that work should mostly be removing unwraps – which is nice.

We’re using the opportunity to clean up a few more things that have crept
into the code over time. A list of which will be added here:

*  The range, slice, and split methods on the domain name types have
   changed. They have been merge into a single method taking ranges – except
   for those on `Dname` that require type changes. The split methods now
   take references and don’t change `self` anymore. This is somewhat
   required by the limitations imposed by the new `Octets` trait but feels
   better, anyway.

*  The `Parse`, `Compose`, and `Scan` traits have been demoted to mere
   extension traits for foreign types (primarily the built-in integers, so
   that you can do things like `u16::parse`). All other types now simply have
   methods matching the patterns. Where generics are necessary, dedicated
   traits have been added. E.g., there now are `ParseRecordData` and
   `ComposeRecordData` traits that are implemented by all record data types.

*  Composing of record data and options has been switched to a scheme where
   the size is predetermined whenever possible instead of composing the data
   and then updating the length after. Since this is not possible for record
   data that uses compressed names when compression is actually in use, the
   old scheme is still used in this particular case.
2023-01-10 12:48:41 +01:00
Martin HoffmannandGitHub cd88889557 Redesign zone file parsing. (#142)
This commit completely redesigns zone file parsing. The primary change is to
convert the scanner into a trait in order to allow multiple zone parser
implementations for different sources and purposes. A number of changes had
to be made in order to make this possible.

The commit also contains an initial implementation of a scanner that modifies
data in-place and can thus returned parsed data with only a minimal amount
of additional allocations. While working, this scanner is more a
proof-of-concept at this point to ensure that the API design is sound.

This commit is based on ideas and code proposed by @not-my-profile in #106.

This commit increases the minimal supported Rust version to 1.59.0.
2022-11-07 15:11:36 +01:00
Martin Hoffmann 23cedfa7dd Only run Clippy on stable Rust. 2022-09-15 12:43:58 +02:00
Martin HoffmannandGitHub 9d937070ed Fix errors in --no-default-features built. (#129)
Also enables the `--tests` flag when building with --no-default-features in the CI.
2022-04-21 14:12:13 +02:00
Martin HoffmannandGitHub 997ad926a9 The minimum support rust version is now 1.56.1. (#128) 2022-04-21 11:52:08 +02:00
Martin Hoffmann 067d1a6874 Fix workflow syntax. 2021-11-24 12:07:12 +01:00
Martin Hoffmann 11a3b34935 CI: Only run Clippy on stable and nightly. 2021-11-24 12:05:41 +01:00
Martin Hoffmann 9b7daf69fd Increase minimum supported Rust version to 1.52. 2021-11-24 10:49:02 +01:00
Martin Hoffmann 257caf0aac Introduce a ci-test feature rather than editing the workflow file. 2021-11-12 17:41:39 +01:00
Martin Hoffmann 7f9eab0f8c Increase minimum supported Rust version to 1.49. 2021-07-29 12:21:31 +02:00
Martin Hoffmann 5439169b56 Disable Clippy on the beta channel. 2021-05-26 11:10:31 +02:00
Martin HoffmannandGitHub 0ddde30e71 Merge pull request #85 from koivunej/do_rustfmt
cargo fmt
2021-01-14 11:14:28 +01:00
Joonas Koivunen f7c4153b4d ci: add minimal-versions check and test 2021-01-13 18:33:37 +02:00
Joonas Koivunen 5d47aa24fc ci: add stable cargo fmt check
run clippy only on ubuntu-latest as it doesn't seem to be installed on
windows. however all code is processed by rustfmt regardless of the
target.
2021-01-13 16:03:44 +02:00
Martin Hoffmann bb46dcc8ae Don’t include the interop feature in Github Actions. 2020-08-27 11:48:35 +02:00
Martin Hoffmann e956ab4732 Fix CI workflow. 2020-08-27 10:44:26 +02:00
Martin Hoffmann 6a8fafed59 Update minimal Rust version to 1.45. 2020-08-25 17:55:11 +02:00
Martin Hoffmann c69e8aae45 No features in test in workspace. 2020-03-24 14:00:40 +01:00
Martin Hoffmann 03769518bd Minimum Rust version is 1.42.0. 2020-03-24 13:44:30 +01:00
Martin Hoffmann 20ec910055 Switch to Github Actions. 2020-03-24 13:43:30 +01:00