on master help sign in
Fix panic opening rust file

Application::new will use stuff that requires tokio runtime.

commiteab6e535117217ae640444c4b6b385f9541273a5 authorIvan Tham <pickfire@riseup.net> dateWed 2 Jun 2021, 22:03 (5 years ago) parent0a6672c
1 file changed+3−6
helix-term/src/main.rs+3−6
helix-term/src/main.rs+3−6
@@ -51,7 +51,8 @@ pub struct Args {
5151 files: Vec<PathBuf>,
5252}
5353
54−fn main() -> Result<()> {
54+#[tokio::main]
55+async fn main() -> Result<()> {
5556 let help = format!(
5657 "\
5758{} {}
@@ -113,13 +114,9 @@ FLAGS:
113114 let config = toml::from_slice(toml).context("Could not parse languages.toml")?;
114115 LOADER.get_or_init(|| Loader::new(config));
115116
116− let runtime = tokio::runtime::Runtime::new().context("unable to start tokio runtime")?;
117−
118117 // TODO: use the thread local executor to spawn the application task separately from the work pool
119118 let mut app = Application::new(args).context("unable to create new appliction")?;
120− runtime.block_on(async move {
121− app.run().await;
122− });
119+ app.run().await;
123120
124121 Ok(())
125122}