summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Tham2021-06-02 14:03:33 +0000
committerIvan Tham2021-06-02 15:49:26 +0000
commiteab6e535117217ae640444c4b6b385f9541273a5 (patch)
tree346b4a753c9755b62b5a40c8efe00f5b83f42cb9
parent0a6672c6261062eb13ed8c30ab2800c340e5f6ac (diff)
Fix panic opening rust file
Application::new will use stuff that requires tokio runtime.
-rw-r--r--helix-term/src/main.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/helix-term/src/main.rs b/helix-term/src/main.rs
index 3a0f4d20..da03569d 100644
--- a/helix-term/src/main.rs
+++ b/helix-term/src/main.rs
@@ -51,7 +51,8 @@ pub struct Args {
files: Vec<PathBuf>,
}
-fn main() -> Result<()> {
+#[tokio::main]
+async fn main() -> Result<()> {
let help = format!(
"\
{} {}
@@ -113,13 +114,9 @@ FLAGS:
let config = toml::from_slice(toml).context("Could not parse languages.toml")?;
LOADER.get_or_init(|| Loader::new(config));
- let runtime = tokio::runtime::Runtime::new().context("unable to start tokio runtime")?;
-
// TODO: use the thread local executor to spawn the application task separately from the work pool
let mut app = Application::new(args).context("unable to create new appliction")?;
- runtime.block_on(async move {
- app.run().await;
- });
+ app.run().await;
Ok(())
}