refactor(link): add Ok and make IoError more understandable
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
This commit is contained in:
parent
f17e2a5986
commit
4a0f855b67
1 changed files with 8 additions and 3 deletions
11
src/git.rs
11
src/git.rs
|
@ -598,6 +598,10 @@ impl Config {
|
|||
let mut sp =
|
||||
Spinner::new(Spinners::Dots10, format!("{}: {}", link.name, op));
|
||||
match f(link) {
|
||||
Ok(_) => sp.stop_and_persist(
|
||||
success_str(),
|
||||
format!("{}: {}", link.name, op),
|
||||
),
|
||||
Err(e @ LinkError::AlreadyLinked(_, _)) => {
|
||||
sp.stop_and_persist(success_str(), format!("{e}"))
|
||||
}
|
||||
|
@ -613,9 +617,10 @@ impl Config {
|
|||
Err(e @ LinkError::FailedCreatingLink(_, _)) => {
|
||||
sp.stop_and_persist(failure_str(), format!("{e}"))
|
||||
}
|
||||
Err(e @ LinkError::IoError(_)) => {
|
||||
sp.stop_and_persist(failure_str(), format!("{e}"))
|
||||
}
|
||||
Err(e @ LinkError::IoError(_)) => sp.stop_and_persist(
|
||||
failure_str(),
|
||||
format!("{}: {op}, {e}", link.name),
|
||||
),
|
||||
Err(e) => sp.stop_and_persist(failure_str(), format!("{e}")),
|
||||
_ => sp.stop_and_persist(
|
||||
failure_str(),
|
||||
|
|
Loading…
Reference in a new issue