Considering that "dialoguer" uses "console" backend library, and the
future of himalaya is reliant on "crossterm", we are moving from
dialoguer, to inquire.
This commit is going to include some experimental changes to one file.
Signed-off-by: Perma Alesheikh <me@prma.dev>
Since Himalaya is intended to be ran as a CLI in the terminal emulator
environment, their user experience could vastly improve with better and
more colorful error messages and logging.
This change will replace more minimal libraries for error-reporting/han-
dling with their more advanced counterparts.
Since these crates have tight integrations, this commit will change both
in one shot.
Also we have don't need env_logger any more. So I also have removed that
guy as well.
Signed-off-by: Perma Alesheikh <me@prma.dev>
Reasons:
- Avoid unnecessary conversion, since into is called on an String value
when String is expected, anyway.
Signed-off-by: Perma Alesheikh <me@prma.dev>
Reasons:
- Filter_map will run forever if iterator only returns Err with lines.
This is a possibility for "lines" iterators.
- Map_while will break the mapping the moment the iterator returns error.
Signed-off-by: Perma Alesheikh <me@prma.dev>
Reasons:
- Map is usually intended for transforming a value, and as is not
idiomatically used for only doing side-effects and control flow.
Signed-off-by: Perma Alesheikh <me@prma.dev>
Reasons:
- Every field is either turned-off entirely or assigned a value when it
needs one.
- Avoids the situation when a new field is introduced and is assigned a
default value when it is not desired.
Signed-off-by: Perma Alesheikh <me@prma.dev>
Reasons:
- From Implementation also implements Into trait.
- Adhere to the recommendation by the Into trait's comments.
Signed-off-by: Perma Alesheikh <me@prma.dev>