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