Fintan Halpenny adaed6a3ac radicle: validated construction of Project
The `validate` method of `Project` was unused, which is problematic if
the attributes are supposed to be validated based on some
constraints. The issue is that `Project` provided public construction
of its fields with enforcing validation.

This change makes `Project`'s attributes private and introduces a
smart constructor `new` which is fallible if any of the constraints
are not met. The error type was changed to be a vector of errors since
all of these errors can be collected for better error reporting.

Deserialization also provided a way of constructing a `Project`
without ensuring any of the constraints were checked. To prevent this
a hand-rolled `Deserialize` is provided that goes through
`Project::new`.

To access the fields of `Project`, accessor functions are added and
all call sites are updated to use them.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2022-12-27 12:23:39 +01:00
2022-12-15 20:55:26 +01:00
2022-12-19 13:03:15 +00:00
2022-12-15 20:55:26 +01:00
2022-12-15 20:55:26 +01:00
2022-11-05 12:47:26 +01:00
2022-12-15 20:55:26 +01:00
2022-12-14 17:15:40 +01:00
2022-09-13 10:13:13 +02:00
2022-11-16 12:26:12 +01:00
2022-10-14 13:19:28 +02:00
2022-12-15 20:55:26 +01:00

❤️🪵

Radicle Heartwood Protocol & Stack

S
Description
Radicle Heartwood Protocol & Stack
Readme
40 MiB
Languages
Rust 97.8%
Shell 0.5%
CUE 0.4%
Nix 0.3%
Just 0.3%
Other 0.6%