Age | Commit message (Collapse) | Author |
|
This patch was scripted with
sed -i 's/use failure::Error/use anyhow::Error/' $(rg "use failure::Error" -l)
sed -i 's/use failure::Fallible as /use anyhow::/' $(rg "use failure::Fallible" -l)
sed -i 's/failure/anyhow/' $(rg "failure *=" -l)
sed -i 's/format_err!/anyhow!/' $(rg "format_err!" -l)
sed -i 's/use failure::ResultExt/use anyhow::Context/' $(rg "use failure::ResultExt" -l)
sed -i 's/err_msg/anyhow!/' $(rg "use failure::err_msg" -l)
sed -i 's/^anyhow\ *=.*$/anyhow = "1"/' $(rg "anyhow * =" -l)
sed -i 's/^anyhow_derive.*//' $(rg "anyhow_derive" -l)
sed -i 's/extern crate failure/extern crate anyhow/' $(rg "extern crate failure" -l)
sed -i 's/.*extern crate anyhow_derive.*//' $(rg "anyhow_derive" -l)
Some manual changes were added as well, so this patch was not completely
scripted, but mostly.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Because when showing an instance, we try to get the comment for the
instance from the habit template, which tries to Store::get() the
template in HabitInstance::get_comment().
This fails if the template is already borrowed, thus drop the borrow
before the whole thing.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Leon Schuermann <leon@is.currently.online>
|
|
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
|
|
The implementation of `HabitInstance::get_comment()` was changed and
therefore its semantics were changed.
This patch adapts the call to the function for the new signature and
implications.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
This patch adds a marker in the table when using the "list" command
which marks when the task is already done for the list entry.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
We Iterator::filter here, so we have to negate - because we list
everything where _no_ instance exists yet.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
This patch removes the magic constant we used when calling
`trace_unwrap_exit()` or `map_err_trace_exit_unwrap()`.
We used to call it with `1` as parameter, where the number was the exit
code to use. Now the implementation of the function does it
automatically (using 1 (one) as exit code).
All calls of these functions were fixed. Thanks to vim this was easy.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Because this API only errors when write!() errors occur, we can return
the exit code as an error here.
This way the user of the API can immediately exit if there was an IO
error, but the API automatically takes care of the right return value,
returning (exiting) with zero (0) if there was an "Broken pipe" error
and with one (1) otherwise, which is the expected behaviour here.
All calls to that API were changed accordingly.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
If we call 'imag-habit' without a subcommand, we assume "today". Thus it
might occur that the "status" subcommand match is not present, hence we
have to assume `false` here as default value.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
|
|
This patch simplifies the code to be not three nested matches but rather
one match and then some function chaining.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
In the imag-contact crate we had to rewrite the ask_continue!{} macro
as a function for less headache, but besides that this is a rather
straight-forward patch for adapting to the new interface.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
And add missing header in one file
|
|
|
|
Because the "version" crate is licensed as GPL, which would us require
to release imag as GPL, we remove the crate now.
|
|
|
|
|
|
With cd8f0beae864c06f02b0d43fe4b63a0ba580229a
the interface of `HabitTemplate::next_instance_date()` changed to return
a `Result<Option<_>>` rather than a `Result<_>` because the
next_instance_date could be a None if the Habit was closed already.
This patch adapts imag-habit for this new interface.
|
|
|
|
|
|
|
|
|
|
|
|
|