From e6b287d3773fa18ec784493e41b2c49d3d1cfda3 Mon Sep 17 00:00:00 2001 From: naskya Date: Fri, 21 Jun 2024 10:10:00 +0900 Subject: [PATCH] rename functions --- src/command/config/update.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/command/config/update.rs b/src/command/config/update.rs index 2a08f3c..4b9ba54 100644 --- a/src/command/config/update.rs +++ b/src/command/config/update.rs @@ -42,16 +42,16 @@ fn take_backup() -> Result<(), UpdateError> { Ok(()) } -async fn update_to_latest(mut revision: Revision) -> Result<(), UpdateError> { - while let Some(next_revision) = revision.next() { - run_impl(&next_revision).await?; - revision = next_revision.clone(); +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(); } Ok(()) } /// 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 { Revision::V0 => unreachable!(), Revision::V1 => v1::run().await?, @@ -71,7 +71,7 @@ pub(super) async fn run(revision: Option) -> Result<(), UpdateError> { } match revision { - Some(revision) => run_impl(&revision).await, - None => update_to_latest(current_revision).await, + Some(revision) => update_to(&revision).await, + None => update_to_latest_from(current_revision).await, } }