Commit Graph

10 Commits

Author SHA1 Message Date
Lucien Cartier-Tilet 6be0f7e8f6
Switched rules to Regexes, added Regex wrapper for serde 2020-03-29 03:10:19 +02:00
Lucien Cartier-Tilet d13836e433
Removed comments, made Settings members public, doc 2020-03-29 03:09:48 +02:00
Lucien Cartier-Tilet 18eb16e777
Rewritten some parts as macros, updated extension handling
Encoding and decoding of `settings::Settings` now handled in macros to
avoid code repetition. I also wish rewrite them both in a combined
macro that would either encode or decode the struct depending on how
it was called.

Replaced some log warnings with errors

Now if type extension is not valid, the code will still attempt to
decode it, first as JSON data, then as Yaml data. If both fail, then
an error is returned. For this, I added the Display trait to the
`settings::Settings` struct which allows the FromStr trait, and due
to conflicting implementation, I removed the From trait and
implemented manually the `from` method with the same signature -- the
struct just lacks the trait that comes with it.
2020-03-28 22:03:21 +01:00
Lucien Cartier-Tilet a7ef031090
Final doc before I go to sleep 2020-03-27 23:31:24 +01:00
Lucien Cartier-Tilet 7d0a371311
Changed ruleset variable type to i32 2020-03-27 23:26:16 +01:00
Lucien Cartier-Tilet e00f489f55
Added From trait to Settings 2020-03-27 23:25:16 +01:00
Lucien Cartier-Tilet 8642067eb3
Updated settings::utils::write_file’s signature for more flexibility
`write_file` now accepts as its second argument any type that
implements the `ToString` trait so that not only Strings will be
accepted but any type that can be turned into one.
2020-03-27 19:09:34 +01:00
Lucien Cartier-Tilet 488ceba1bb
Added some doc and tests 2020-03-27 19:08:47 +01:00
Lucien Cartier-Tilet 2e0c16e97c
Added functions to import and export settings and refactoring 2020-03-27 18:25:20 +01:00
Lucien Cartier-Tilet ff95cb05eb
Added some basic code
Added basic settings representation and a way to load them from either
a YAML or Json file.
2020-03-26 20:10:07 +01:00