With this patch we move the codebase to Rust-2018.
The diff was generated by executing
cargo fix --all --all-features --edition
on the codebase.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Because the code was so complex before, we had to create an object and
then cast that object into a `StoreId` rather than just creating a
`StoreId` object right away.
With this patch, we're using the code-generation approach to generate a
function that creates a `StoreId` object based on the name of the
current module. That's way easier and error handling was also improved
by the switch to the new implementation.
The patch also includes a rewrite of all usages of ModuleEntryPath and
changes them to `module_path::new_id()` calls.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Rewrite to collect not so often internally. This removes one collect()
from the implementation. One is still there in the sorted_by() call,
though.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
We need to reverse the iterator for getting the _youngest_ entry here.
Also seems to fix the issue that imag-diary edit -d <date> did not work
properly.
This patch rebuilds DiaryEntryIterator to be a wrapper around
StoreIdIterator and thus `Diary::entries()` to use `Store::entries` and
not `Store::retrieve_for_module()`.
The `Store::retrieve_for_module()` function is somehow buggy and loads
contents of the files into memory and _somehow_ causes the entries to be
rewritten without newlines.
This bug is fixed by moving away from `Store::retrieve_for_module()`.
This merge solved a _LOT_ of conflicts and was a rather complicated one,
as parts of the conflict-resolution involved rewriting of half the
stuff.
This merge commit fixes all the things so a `cargo check --all`
succeeds, but I did not yet check whether tests run without failure.
This patch removes unused crate imports reported by newer rust versions.
Some crates were only required for tests, some only for tests with
macro_import - these things were fixed with feature gates.