From e646490d169885a0bf4a7ed6aa397b098e11075d Mon Sep 17 00:00:00 2001 From: Weny Xu Date: Tue, 23 May 2023 11:09:34 +0900 Subject: [PATCH] chore: fix code styling (#1623) --- src/cmd/src/bin/greptime.rs | 14 +++++++------- src/cmd/src/cli.rs | 2 +- src/cmd/src/datanode.rs | 2 +- src/cmd/src/frontend.rs | 2 +- src/cmd/src/metasrv.rs | 2 +- src/cmd/src/standalone.rs | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/cmd/src/bin/greptime.rs b/src/cmd/src/bin/greptime.rs index d419a2432d..36448d5661 100644 --- a/src/cmd/src/bin/greptime.rs +++ b/src/cmd/src/bin/greptime.rs @@ -46,13 +46,13 @@ pub enum Application { } impl Application { - async fn run(&mut self) -> Result<()> { + async fn start(&mut self) -> Result<()> { match self { - Application::Datanode(instance) => instance.run().await, - Application::Frontend(instance) => instance.run().await, - Application::Metasrv(instance) => instance.run().await, - Application::Standalone(instance) => instance.run().await, - Application::Cli(instance) => instance.run().await, + Application::Datanode(instance) => instance.start().await, + Application::Frontend(instance) => instance.start().await, + Application::Metasrv(instance) => instance.start().await, + Application::Standalone(instance) => instance.start().await, + Application::Cli(instance) => instance.start().await, } } @@ -188,7 +188,7 @@ async fn main() -> Result<()> { let mut app = cmd.build(opts).await?; tokio::select! { - result = app.run() => { + result = app.start() => { if let Err(err) = result { error!(err; "Fatal error occurs!"); } diff --git a/src/cmd/src/cli.rs b/src/cmd/src/cli.rs index 348a550439..428aa74ffb 100644 --- a/src/cmd/src/cli.rs +++ b/src/cmd/src/cli.rs @@ -28,7 +28,7 @@ pub struct Instance { } impl Instance { - pub async fn run(&mut self) -> Result<()> { + pub async fn start(&mut self) -> Result<()> { self.repl.run().await } diff --git a/src/cmd/src/datanode.rs b/src/cmd/src/datanode.rs index b6be54f670..ae2c110b2d 100644 --- a/src/cmd/src/datanode.rs +++ b/src/cmd/src/datanode.rs @@ -29,7 +29,7 @@ pub struct Instance { } impl Instance { - pub async fn run(&mut self) -> Result<()> { + pub async fn start(&mut self) -> Result<()> { self.datanode.start().await.context(StartDatanodeSnafu) } diff --git a/src/cmd/src/frontend.rs b/src/cmd/src/frontend.rs index af832ed84c..9e6fd1ed66 100644 --- a/src/cmd/src/frontend.rs +++ b/src/cmd/src/frontend.rs @@ -33,7 +33,7 @@ pub struct Instance { } impl Instance { - pub async fn run(&mut self) -> Result<()> { + pub async fn start(&mut self) -> Result<()> { self.frontend .catalog_manager() .start() diff --git a/src/cmd/src/metasrv.rs b/src/cmd/src/metasrv.rs index ba0c9a6c12..784a4cd133 100644 --- a/src/cmd/src/metasrv.rs +++ b/src/cmd/src/metasrv.rs @@ -28,7 +28,7 @@ pub struct Instance { } impl Instance { - pub async fn run(&mut self) -> Result<()> { + pub async fn start(&mut self) -> Result<()> { self.instance .start() .await diff --git a/src/cmd/src/standalone.rs b/src/cmd/src/standalone.rs index 97415329b1..d76e36ddb7 100644 --- a/src/cmd/src/standalone.rs +++ b/src/cmd/src/standalone.rs @@ -152,7 +152,7 @@ pub struct Instance { } impl Instance { - pub async fn run(&mut self) -> Result<()> { + pub async fn start(&mut self) -> Result<()> { // Start datanode instance before starting services, to avoid requests come in before internal components are started. self.datanode .start_instance()