rename functions
This commit is contained in:
parent
86cc487e1e
commit
e6b287d377
1 changed files with 7 additions and 7 deletions
|
@ -42,16 +42,16 @@ fn take_backup() -> Result<(), UpdateError> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn update_to_latest(mut revision: Revision) -> Result<(), UpdateError> {
|
async fn update_to_latest_from(mut current_revision: Revision) -> Result<(), UpdateError> {
|
||||||
while let Some(next_revision) = revision.next() {
|
while let Some(next_revision) = current_revision.next() {
|
||||||
run_impl(&next_revision).await?;
|
update_to(&next_revision).await?;
|
||||||
revision = next_revision.clone();
|
current_revision = next_revision.clone();
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Updates config files to the specified revision.
|
/// Updates config files to the specified revision.
|
||||||
async fn run_impl(revision: &Revision) -> Result<(), UpdateError> {
|
async fn update_to(revision: &Revision) -> Result<(), UpdateError> {
|
||||||
match revision {
|
match revision {
|
||||||
Revision::V0 => unreachable!(),
|
Revision::V0 => unreachable!(),
|
||||||
Revision::V1 => v1::run().await?,
|
Revision::V1 => v1::run().await?,
|
||||||
|
@ -71,7 +71,7 @@ pub(super) async fn run(revision: Option<Revision>) -> Result<(), UpdateError> {
|
||||||
}
|
}
|
||||||
|
|
||||||
match revision {
|
match revision {
|
||||||
Some(revision) => run_impl(&revision).await,
|
Some(revision) => update_to(&revision).await,
|
||||||
None => update_to_latest(current_revision).await,
|
None => update_to_latest_from(current_revision).await,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue