The first attempt 02c44c92d0 caused
`Section.partial_cmp` and `Section.cmp` to call each other recursively.
That lead to a stack overflow when compiled without optimizations, and
an infinite loop when optimizations were enabled.
This commit now properly implements at first `Ord` for both `Section`
and `Group`, and from this derives `PartialEq` for each.
When no packages have been installed yet using cargo-install, the rust
backend has errored out until now when trying to load the file. If the
file does not exist, we assume it is empty and that no packages have
been installed for cargo.
So far we have warned the user when we first visited the group dir and
there were no group files. This lead to spurious warnings, e.g. when the
user wanted to import or create a group. We now defer the check to when
we actually need some content in the groups, and the program should not
perform the respective action without any groups present. This causes
some code duplication, but enhances UE.
Closes#31.
So far we have written a default config file if we encountered any error
when trying to read the one that should exist. That included:
* missing key-value-pairs,
* empty file, and
* a non-existant file.
Therefore, when a field is added to the Config struct, the entire config
file was overwritten with a default config. This occured during #20.
Instead, we now provide default values in form of generator functions to
serde. Any value that is present in the config is then parsed and
replaces the default value. Only if the config file does not exist we
create an empty one.
Closes#26.